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
DOC: update static image for interpolation_none_vs_nearest.py example #6591
Comments
How exactly did you produce these images? Note that the example code does not actually create a pdf file, it uses the static file
diff --git a/examples/images_contours_and_fields/interpolation_none_vs_nearest.py b/examples/images_contours_and_fields/interpolation_none_vs_nearest.py
index 802c2d1..ab6dbe5 100644
--- a/examples/images_contours_and_fields/interpolation_none_vs_nearest.py
+++ b/examples/images_contours_and_fields/interpolation_none_vs_nearest.py
@@ -45,18 +45,19 @@ fig.text(0.75, 0.90, "Interpolation = 'nearest'", ha='center')
# would save the figure as a PNG, save the same figure as a PDF, and
# then compare them. The following code would suffice.
txt = fig.text(0.452, 0.95, 'Saved as a PNG', fontsize=18)
-# plt.savefig('None_vs_nearest-png.png')
-# txt.set_text('Saved as a PDF')
-# plt.savefig('None_vs_nearest-pdf.pdf')
+plt.savefig('None_vs_nearest-png.png')
+txt.set_text('Saved as a PDF')
+plt.savefig('None_vs_nearest-pdf.pdf')
# Here, however, we need to display the PDF on a webpage, which means
# the PDF must be converted into an image. For the purposes of this
# example, the 'Nearest_vs_none-pdf.pdf' has been pre-converted into
#'Nearest_vs_none-pdf.png' at 80 dpi. We simply need to load and
# display it.
-pdf_im_path = cbook.get_sample_data('None_vs_nearest-pdf.png')
-pdf_im = plt.imread(pdf_im_path)
-fig2 = plt.figure(figsize=[8.0, 7.5])
-plt.figimage(pdf_im)
+#pdf_im_path = cbook.get_sample_data('None_vs_nearest-pdf.png')
+#pdf_im = plt.imread(pdf_im_path)
+#fig2 = plt.figure(figsize=[8.0, 7.5])
+#plt.figimage(pdf_im)
+
+#plt.show()
-plt.show() |
Aha! I pulled the files straight from the gallery output, I believe, without looking to see what was going on. I was on the lookout for problems with the tick number selection. |
You're right, I was invoking python from a different virtualenv. In any case, even with the correct python the results look similar across the two backends. |
Closed by #6608 |
Gallery output from interpolation_none_vs_nearest.py:
The text was updated successfully, but these errors were encountered: