Skip to content
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

Possible fix for hatching problems inside legends (PDF backend) #4474

Merged
merged 3 commits into from Jun 16, 2015

Conversation

jpallister
Copy link

This commit fixes the issue #4469, but I don't know whether this is the correct way to fix the problem.

@tacaswell
Copy link
Member

attn @jkseppan

@tacaswell tacaswell added this to the next point release milestone May 26, 2015
@@ -2301,7 +2302,13 @@ def delta(self, other):
if different:
break

# Need to update hatching if we also updated fillcolor
if params == ('_hatch',) and fill_performed:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To check the logic, it only matter if the last command was filled so the fact that the first time through is always False is ok?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so. The writeHatches function seems to independently change the fill color (line 1189), so requires updating the hatching if the fill color is modified.

@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Jun 12, 2015
@jkseppan
Copy link
Member

The change looks fine to me, but the whole PDF hatching (originally implemented by me) is somewhat brittle and should probably be redone by turning the fill area into a temporary clip mask and drawing the hatch pattern over the whole area.

This pull request adds a test for the fixed behaviour, so it should survive any future changes. Could the test be extended to other backends as well? I'm not entirely sure if the interaction between hatching and edge/fill colors is well defined, so a test across all relevant backends would help make sure it means the same thing everywhere.

@tacaswell
Copy link
Member

Good point on the other backends, that this fix didn't break anything means this code path is not tested anywhere else.

@tacaswell
Copy link
Member

I am going to go ahead and merge this as-is.

@jpallister If you are feeling ambitious extending your test to the other backends in a PR would be great.

tacaswell added a commit that referenced this pull request Jun 16, 2015
BUG: fix for hatching problems inside PDF legends
@tacaswell tacaswell merged commit ab101e9 into matplotlib:master Jun 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants