-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Hatching in EPS figures doesn't show up in Preview on MacOS X with Matplotlib 2.0 #8289
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
Just to be sure: the hatches do actually exist in the EPS file (e.g. the issue is only with the preview)? I ran your MWE on Linux and Python 2 with Matplotlib 1.5.1 and 2.0: in Evince I can see hatches in both of them. However the hatches do not look exactly identical between both records, which I guess is due to #7421 (ping @QuLogic) |
@afvincent - yes, I think they do, I can see the hatches if I open the file with ghostscript |
what is the diff between the two files? |
The changes in the individual commits of #7421 are fairly self-contained; it should be possible to try reverting them one at a time to see if they have any effect. At a guess, I'd say this commit and Preview has some trouble with the |
https://github.com/matplotlib/matplotlib/pull/7421/files#diff-b465967f537465fec4960b152fa49cffR903 is likely the specific change at fault. https://www.adobe.com/products/postscript/pdfs/PLRM.pdf has the documentation on this and
pg 264 |
Well, one difference is that the default figure size changed between 1.5
and 2.0. The spacing of the hatches is defined in points, so changing the
figure size will change that. I would suspect that some other changes to
the default style might explain some of the other 1.5/2.0 differences.
…On Wed, Mar 15, 2017 at 4:11 AM, Adrien F. Vincent ***@***.*** > wrote:
Sorry, unexpected workload at day-job last night. So here are the
differences that I can observe both in Evince and GS between Matplotlib
1.5.1 and 2.0:
[image: eps_and_hatches_differences_between_1 5 1_and_2 0]
<https://cloud.githubusercontent.com/assets/17270724/23938998/07c9914c-095f-11e7-9cd8-441e1bf4e2ba.png>
The main one is that the hatches do not have a constant line width with
2.0.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8289 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-JlLM3QikZTrH1ceOWfcURGapSL1ks5rl51OgaJpZM4McSeB>
.
|
@WeatherGod I think the problem is not about the hatching style but more about how hatching is defined when saving in postscript and how it affects the rendering in Preview, Evince, GS, etc. as @QuLogic and @tacaswell have suggested. For example, when the hatches density is doubled ('//' instead of '/'), the not very aesthetic bold segments on some of the hatches are still there in EPS produced by 2.0, while the line width stays smooth and constant with 1.5(.1): |
When I said diff I meant the text diff. I don't think the hatch changing width is real, that looks like issues with the renderer. Do they move around if you pan / zoom / resize the window? |
The answer seems to be no with 1.5.1 (left panels) and yes with 2.0 (right panels): I agree that is is likely to be an issue with how the GS/Evince/Preview do the rendering. I put the EPS files and a diff there |
Punting to 3.0, this is not going to get fixed in the next few days. |
I suspect that the resolution here is going to involve someone fully understanding the eps/pdf spec and then sorting out which of the viewers is buggy.... This reminds me of the clipping issues we hand with librsvg for a while (we were outputting svg that complied with the spec, but rsvg did not render them correctly). |
Guys, has this issue been resolved? It seems like I'm having this problem on the latest module version. Or maybe any workaround? |
@mryodo, I got the behaviour correct by inserting I don't know how to present my modification here, so I just attach my
|
https://stackoverflow.com/questions/6614207/how-to-export-non-blurry-eps-images for another case of Preview apparently not rendering postscript correctly. |
@mksegv Thanx! Works perfectly!
|
Issue is still present in Matplotlib 3.1.1, but the posted fix worked like a charm! Thanks.
|
Does anyone want to open a PR for that change? |
This should have been fixed by #15064. |
Patches that have a hatch pattern in EPS plots don't show the hatch pattern when opened in Preview on MacOS X. This may be a Preview bug rather than a Matplotlib bug, but I wanted to check whether anything can be done on the Matplotlib side to avoid this (since the likelihood Apple will care about this issue is minimal). This was not a problem with Matplotlib 1.5, only with 2.0, so in that sense this is a regression.
To reproduce this:
PNG:
EPS, as viewed in Preview on MacOS X:
The above is with Matplotlib 2.0. With 1.5, Preview correctly shows the hatch pattern:
I'm using MacOS X 10.11.6
The text was updated successfully, but these errors were encountered: