-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
pdf-backend for savefig produces unusual grouping within pdf element #15051
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
I can repro this issue with mupdf/ghostscript, but not with poppler (okular). Not sure whether it's the readers not following the spec, or not. |
Since ungrouping in Adobe Illustrator solves the problem, could you share (1) a small problematic file from matplotlib; |
Here you are. Since Illustrator supports different versions of PDF, I've picked the newest and oldest available version (1.3 and 1.7). I used the above sample code to create the PDF (sample-original.pdf). The only action performed in Illustrator was to ungroup the items (Cmd+Shift+G), followed by "Save as". sample-original.pdf |
So I think that makes this a duplicate of #10035. |
Bug report
Bug summary
When saving the figure as a PDF, the items are grouped unusually, which leads to unexpected results when shown in a viewer that supports knockout effects.
While this is not problematic most of the time, the issue causes troubles if the PDF created by matplotlib is edited within Illustrator (possibly other PDF editors as well).
Code for reproduction
Actual outcome
Because I initially thought this is an Illustrator related problem, I posted a (very detailed) description in one of the Adobe Forums.
In (MacOS) Preview.app

In Adobe Illustrator:

In the Adobe Illustrator forum I got the feedback that the grouping of the items is unusual and causes the confusion. Indeed, ungrouping the elements resolved all of my problems.
Expected outcome
Same as in default preview app.
Matplotlib version
The text was updated successfully, but these errors were encountered: