-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added 'interpolation_none_vs_nearest' example, without .DS_store files #2995
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
Added 'interpolation_none_vs_nearest' example, without .DS_store files #2995
Conversation
Minor rewording to "interpolation_none_vs_nearest.py" description.
Can you add a few sentences to |
@tacaswell I just looked through |
I agree, this isn't a whats_new.rst item. CHANGELOG makes more sense. On Tue, Apr 22, 2014 at 9:14 AM, Benjamin Reedlunn <[email protected]
|
Hmmm. Well, I am glad tcaswell suggested I check if this example gets added to the gallery. When I build the documentation, the example does get added to the gallery, but only the pdf, and it doesn't look right. As you can see below, the image that is titled "saved as a pdf" now looks like the image titled "saved as a png". The same goes for the examples documentation: only one image file, and it looks like the "saved as a png", even though it is titled "saved as a pdf". Meanwhile, in /matplotlib-root/examples/images_contours_and_fields the two files were recreated, the pdf and the png, and they both look right. I am guessing that the documentation build process just takes the figure window at the end of the example script, and creates a png. This is not what I want. I want it to save the pdf file and then convert the pdf to a png afterward. Is there a way to do this? |
@mdboom Can you take a look at this? I know very little about the sphinx plot directives. The simple solution might be to just use two figure objects. |
Using two figure objects will give me two images, but the "saved as pdf" will look exactly like the "saved as png", which defeats the entire point of the example. It would be nice if the documentation build process would accommodate saving as vector graphics file before creating a png, but here is a work around. I can save the file as a svg, convert the svg to a png, load the png into a matplotlib figure window, and then the documentation build process should take care of the rest. The issue I see with this approach is I have to |
I don't think we would want the documentation build process to have these two additional dependencies, but @mdboom could provide more insight. |
Why not add the "saved as pdf" image as a static image rather than an On Wed, Apr 23, 2014 at 10:48 PM, Eric Firing [email protected]:
|
WeatherGod's suggestion seems like a reasonable solution. The issue I see with using a static image is 'Nearest_vs_none-pdf.png' will be out of date if anyone in the future changes one of the functions I used to create 'Nearest_vs_none-pdf.png'. If everyone is ok with that, then I can change the end of the example script to be:
|
Changing any of the relevant functions here would be a major API break so I would not worry about that too much. |
When building the documentation, is there some way to only rebuild whatever has changed? It takes 20-30 minutes each time on my old laptop. |
Changed the last few lines so that the auto-documentation build process correctly displays the results of the example.
…tplotlib into image-interpolation-example
Ok. I have updated the My pull request is ready for review. |
Added 'interpolation_none_vs_nearest' example, without .DS_store files
Merged. Thanks for the contribution! |
Ok. I think I did the pull request correctly this time, and I did not include the .DS_store files.
@tcaswell suggested (#2972) I put together this example when I realized the difference between interpolation = 'none' and interpolation = 'nearest' in imshow(). The docstring for imshow() mentions this difference, but pictures are worth a thousand words.