-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Graph is wrong when saved as .eps #14272
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
Comments
Thanks for the report. Can you make a minimal example that duplicates the problem (though this may be a duplicate). Also matplotlib 3.1 doesn’t work w py2.7 so please check your versions. |
My apologies, the version number is 2.2.4 I will change this now. |
From reading the code alpha in your graph which is not supported by eps (at the file specification level). Could you provide some synthetic data? It is much easier to debug things if we have runnable code to test. |
Thanks for your response, I have attached some figures and updated the code with dummy data. Unfortunately it seems eps files cannot be uploaded to github so you will have to generate the figure yourself. |
Simple example, python 3, mpl 2.2.2 and 3.1.0.post1017+g4b50ce6cc:
The hatching appears only in the pdf file. |
@efiring's example works for me on |
Actually, it's the opposite; no hatches appear in the pdf (this seems to be a viewer problem.) |
OSX Catalina (10.15.3): On OSX, preview always converts to pdf before displaying eps. In this case, it displays the original pdf fine, but the pdf it generates from the eps is displayed with no hatching. On Linux (an Xubuntu VM on VirtualBox), the Atril viewer shows no hatching for the pdf, but does show the hatching for the eps. So yes, it's viewer dependent, but still points to a bug in our file generation. I wonder whether it is related to zorder, and the differences are in whether the background or the hatch ends up on top. |
The The PostScript and PDF backends are similar but do have one key difference: PS uses an uncolored tiling pattern and sets black as the colour when applying it as strokes over top the rectangle that's already drawn, while PDF uses a colored tiling pattern that includes both the background and the strokes which is applied together to draw the whole rectangle. |
I wonder if the EPS part was fixed by #15064? |
Bug report
Bug summary
Cross-hatching and shaded regions not being rendered when saving a figure as .eps (a format which most journals prefer). pdf and png work fine.
Code is as Follows, cannot show actual data since it is sensitive material at this stage
Actual outcome
Unfortunately I am unable to share data from this graph. Dummy data instead:
Expected outcome
The graph rendered with cross-hatching and shaded regions
Matplotlib version
print(matplotlib.get_backend())
):Installed matplotlib via pip
The text was updated successfully, but these errors were encountered: