I am trying to create a contour plot with the contours filled with hatches and no color. The following example works if I save it to .png but when I save it to .pdf the output is just the axis.
Is the figure above what you expected to see when saving to a .pdf file? If so I think this is fixed on our master branch (we did a couple of patch fixes recently)
There is still something going on while saving hatches to pdf. Left the pdf, right the result of show.
I am not sure if I am reaching the limits to mathplotlib, but to the left also the hatch became transparent.
The problem seems to occur with Acrobat Reader but not Evince. I tested the example from above with Matplotlib 2.0.0, 2.1.0 and from the master branch (on a Linux OS with Python 3.6): every time I get transparent hatches with Acrobat Reader (9.5.5) and correct hatches with Evince.
Activity
dstansby commented on Apr 9, 2017
Is the figure above what you expected to see when saving to a .pdf file? If so I think this is fixed on our master branch (we did a couple of patch fixes recently)
andres0l1 commented on Apr 9, 2017
Hi Dstansby! Thanks what should I do then? Update the library or what exactly? Thanks!
tacaswell commented on Apr 10, 2017
I can confirm that this works correctly on 2.0.x. I suggest installing from git for now, 2.0.1 will be out soon with this fix.
I have not checked, but I suspect this was fixed by f6b4a32 / #7976
tacaswell commented on Apr 10, 2017
either the master branch or 2.0.x should work.
andres0l1 commented on Apr 10, 2017
Thanks a lot!!!
tacaswell commented on Apr 11, 2017
Closing as resolved, keep an eye out for the next release.
mschauer commented on Nov 30, 2017
There are still problems on version 2.0.2 with saving hatches into pdfs. I am calling
dstansby commented on Nov 30, 2017
2.1 is our latest release. Could you upgrade to that and let us know if there are still issues?
mschauer commented on Nov 30, 2017
I am now on 2.1.0 which fixes the problem. Thank you for the guidance.
dstansby commented on Nov 30, 2017
No problem!
mschauer commented on Nov 30, 2017
There is still something going on while saving hatches to pdf. Left the pdf, right the result of show.
I am not sure if I am reaching the limits to mathplotlib, but to the left also the hatch became transparent.
import matplotlib.pyplot as plt xx = [1,2,3,4,5] upper = [3,3,3,3,4] lower = [1,2,2,2,2] plt.fill_between(xx, upper, lower, edgecolor="darkred", facecolor=[0.5,0.5,0.5,0.1], hatch="X", label="as") plt.legend() plt.savefig('ups.pdf') plt.show()afvincent commented on Nov 30, 2017
The problem seems to occur with Acrobat Reader but not Evince. I tested the example from above with Matplotlib 2.0.0, 2.1.0 and from the master branch (on a Linux OS with Python 3.6): every time I get transparent hatches with Acrobat Reader (9.5.5) and correct hatches with Evince.
Worth opening a new dedicated issue?
tacaswell commented on Nov 30, 2017
@afvincent yes please