8000 ENH new static images for the frontpage by NelleV · Pull Request #7541 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

ENH new static images for the frontpage #7541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 3, 2016
Merged

ENH new static images for the frontpage #7541

merged 4 commits into from
Dec 3, 2016

Conversation

NelleV
Copy link
Member
@NelleV NelleV commented Dec 1, 2016

I did not find any code to rebuild the frontpage static images. Here is some code more or less reproducing the front page images, with the new defaults.

Here is the frontpage new look:

screenshot from 2016-11-30 21-51-39

The images are:

contour_frontpage
histogram_frontpage
membrane_frontpage
surface3d_frontpage

If those are fine, i'll commit them to update the website.

I believe long term we could select a few images generated from our gallery, and add them to the frontpage. They will then always be regenerated if the design changes. (We do this for sklearn's frontpage images, and it works nicely).

ref #5654

Here is the code to produce the new static images for the website frontpage
@NelleV NelleV changed the title ENH new static images for the frontpage [WIP] ENH new static images for the frontpage Dec 1, 2016
@NelleV NelleV added this to the 2.0 (style change major release) milestone Dec 1, 2016
@NelleV NelleV changed the title [WIP] ENH new static images for the frontpage [MRG] ENH new static images for the frontpage Dec 1, 2016
@QuLogic
Copy link
Member
QuLogic commented Dec 1, 2016

They're a bit larger; do they fit well on the front page (does the CSS handle it?)?

@NelleV
Copy link
Member Author
NelleV commented Dec 1, 2016

There is a screenshot of the frontpage at the top of the description of the comment that shows the current rendering.

@tacaswell
Copy link
Member
8000 tacaswell commented Dec 2, 2016

The images are fixed to 162x139 in the css (https://github.com/matplotlib/matplotlib/blob/master/doc/_static/mpl.css#L759). We should render them an the same size (to save band width and scaling on the client side).

Copy link
Member
@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

render / crop images at 162px by 138px

@NelleV
Copy link
Member Author
NelleV commented Dec 2, 2016

Feature request: be able to specify px by px size of the images we save !

@NelleV
Copy link
Member Author
NelleV commented Dec 2, 2016

I've committed smaller files. I had expected mpl to save at 72 dpi, and it seems to save at 100px so the images are slightly bigger. @tacaswell is that fine or should I make them smaller again?

Copy link
Member
@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, forgot to submit this review; they're rather minor comments though.

from matplotlib import mlab, cm

# Default delta is large because that makes it fast, and it illustrates
# the correct registration between image and contours.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an image?



datafile = cbook.get_sample_data('membrane.dat', asfileobj=False)
x = np.fromstring(open(datafile, 'rb').read(), np.float32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np.fromfile(datafile, np.float32)

@NelleV
Copy link
Member Author
NelleV commented Dec 2, 2016

@QuLogic Fixed. These "new" examples were done by copy pasting stuff, hence the cryptic comments.

@tacaswell
Copy link
Member

The new default in 100dpi!

@tacaswell
Copy link
Member

and I still would rather they be the correct size.

@NelleV
Copy link
Member Author
NelleV commented Dec 3, 2016

I've fixed the size.

@tacaswell tacaswell merged commit 8349813 into matplotlib:v2.x Dec 3, 2016
@QuLogic QuLogic changed the title [MRG] ENH new static images for the frontpage ENH new static images for the frontpage Dec 3, 2016
@NelleV NelleV deleted the 5654_staticimages branch April 8, 2017 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0