-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix PathEffect rendering on some backends #5217
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
Conversation
The special sub-GC that is created by the PathEffectRenderer was of GraphicsContextBase, rather than the backend-specific GC. Fix matplotlib#5049, Fix matplotlib#4024
|
The docstring of |
@jkseppan: That's a good point. It does seem the Agg backend uses the |
can we hold off on that bit of refactoring until 2.1? Worried about (possibly vaporware) external backends which also rely on this. |
@tacaswell: Sure. That makes sense. It's not really a requirement that a renderer needs a custom GraphicsContext subclass to get things done, so it's quite possible some third-party ones don't and removing the base method would certainly break that. |
I agree, this PR is a minimal bugfix and changing the method in the base class is an API change. |
Added a test. |
@cleanup | ||
def test_patheffects(): | ||
with matplotlib.rc_context(): | ||
matplotlib.rcParams['path.effects'] = [patheffects.withStroke(linewidth=4, foreground='w')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line does not appease pep8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully fixed now.
Fix: PathEffect rendering on some backends
Fix: PathEffect rendering on some backends
back-ported as ff2e4b9 |
The special sub-GC that is created by the PathEffectRenderer was of
GraphicsContextBase, rather than the backend-specific GC.
Fix #5049, Fix #4024
Note that while this fixes the crashes in #5049, it does not mean that the sketch effect behind xkcd actually works in all backends -- that's more of a feature enhancement than a bugfix, because it never worked on all backends.