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

Merged
merged 2 commits into from Apr 17, 2017

Conversation

Projects
None yet
3 participants
@philippjfr
Member

philippjfr commented Apr 17, 2017

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.

@@ -19,12 +20,27 @@
from .util import compute_ratios, fix_aspect
@contextmanager
def rc_context(rcparams):

This comment has been minimized.

@jlstevens

jlstevens Apr 17, 2017

Member

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?

This comment has been minimized.

@philippjfr

philippjfr Apr 17, 2017

Member

Inlining seems inefficient but I'll happily rename.

This comment has been minimized.

@jlstevens

jlstevens Apr 17, 2017

Member

I don't think it is at all inefficient to inline - decorators are only applied once at definition time.

@jlstevens

This comment has been minimized.

Member

jlstevens commented Apr 17, 2017

Looks good apart from one comment. It is suspicious that the context manager supplied by matplotlib doesn't seem to work right...

@basnijholt

This comment has been minimized.

Contributor

basnijholt commented Apr 17, 2017

This fix seems to work for me 👍

@jlstevens

This comment has been minimized.

Member

jlstevens commented Apr 17, 2017

Looks good. Merging.

@jlstevens jlstevens merged commit 078de8b into master Apr 17, 2017

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.005%) to 78.862%
Details
s3-reference-data-cache Test data is cached.
Details

@philippjfr philippjfr deleted the mpl_rccontext branch Apr 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment