-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Added custom rcParam context manager #1300
Conversation
holoviews/plotting/mpl/plot.py
Outdated
@@ -19,12 +20,27 @@ | |||
from .util import compute_ratios, fix_aspect | |||
|
|||
|
|||
@contextmanager | |||
def rc_context(rcparams): |
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.
To avoid confusion maybe this should be _rc_context
if we expect to use the decorator and not this context manager directly. Perhaps you could even inline this context manager inside mpl_rc_context
?
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.
Inlining seems inefficient but I'll happily rename.
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.
I don't think it is at all inefficient to inline - decorators are only applied once at definition time.
Looks good apart from one comment. It is suspicious that the context manager supplied by matplotlib doesn't seem to work right... |
This fix seems to work for me 👍 |
Looks good. Merging. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
For some reason the context manager to set rcParams provided by matplotlib is not working correctly, I've implemented a tiny one of our own here which fixes the bug mentioned in #1299.