-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Incorrect hatching in legend for PDF backend #4469
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
weird. attn @jkseppan |
I suspect that there is a graphics context which is not getting properly reset. |
The following commit fixes the issue in this case: However, I don't know enough to say whether this is the right thing to do. The problem does seem to be the hatch pattern is not reapplied in the PDF backend though. |
@jpallister Great! I also do not know enough about the internals of pdf's to tell if that is the right solution (it seems a bit brittle as I think it depends on the order of the commands), but I am convinced that this is the right place. Can you put in a PR with that commit and maybe add a test, (see #4472 for an example of adding a pdf only test). Even if this is not the final solution, having the commit in a PR greatly helps us with the review process. |
maybe related: #3023 |
Closed by merging #4474 |
When using hatching in a legend, the PDF backend does not draw the hatching if the previous label is empty:
The displayed legend (from plt.show) is:

The legend saved in the PDF is:

If one of the labels is non-empty:
the following hatching is displayed correctly

The text was updated successfully, but these errors were encountered: