fix the pyplot version of rc_context #1866

Merged
merged 1 commit into from Mar 28, 2013

2 participants

@ivanov
Matplotlib Developers member

Before this, when using the rc_context dangling from pyplot, one would
get an AttributeError for __exit__, because plt.rc_context wasn't
actually returning anything before this change.

@ivanov ivanov fix the pyplot version of rc_context
Before this, when using the rc_context dangling from pyplot, one would
get an AttributeError for ``__exit__``, because plt.rc_context wasn't
actually returning anything before this change.
4052840
@ivanov
Matplotlib Developers member

even though this is a bugfix, it doesn't apply to v1.2.x, because pyplot didn't expose rc_context, it was only available from matplotlib proper.

@ivanov
Matplotlib Developers member

Travis error on Py2.6 because it couldn't satisfy the PIL requirement, so I think that's a dud. 2.7 and 3.2 are green

@pelson
Matplotlib Developers member

The fix is good. 👍 on that front.
I wonder if we need rc_context in pyplot though? It's fairly easy to get at with matplotlib.rc_context...

@ivanov
Matplotlib Developers member

plt.rc() and plt.rcdefaults() have been there since at least 2007 (git blame tells me that @efiring was the last to edit those lines then). So previously we could permanently change the rc params from plt, but not temporarily, and since now we have the handy contextmanager to do just that, it makes sense to expose it in the same place.

@pelson pelson merged commit cf6b26f into matplotlib:master Mar 28, 2013

1 check failed

Details default The Travis build could not complete due to an error
@pelson
Matplotlib Developers member

So previously we could permanently change the rc params from plt, but not temporarily, and since now we have the handy contextmanager to do just that, it makes sense to expose it in the same place.

I can't argue with that. 😉

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