Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix the pyplot version of rc_context #1866

Merged
merged 1 commit into from

2 participants

@ivanov
Collaborator

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
Collaborator

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
Collaborator

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
Collaborator

The fix is good. :+1: 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
Collaborator

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 from
@pelson
Collaborator

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. :wink:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 28, 2013
  1. @ivanov

    fix the pyplot version of rc_context

    ivanov authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/matplotlib/pyplot.py
View
2  lib/matplotlib/pyplot.py
@@ -197,7 +197,7 @@ def rc(*args, **kwargs):
@docstring.copy_dedent(matplotlib.rc_context)
def rc_context(rc=None, fname=None):
- matplotlib.rc_context(rc, fname)
+ return matplotlib.rc_context(rc, fname)
@docstring.copy_dedent(matplotlib.rcdefaults)
def rcdefaults():
Something went wrong with that request. Please try again.