diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 77d25bbe3358..70499b77ab07 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -1062,6 +1062,9 @@ def rc_context(rc=None, fname=None): The :rc:`backend` will not be reset by the context manager. + rcParams changed both through the context manager invocation and + in the body of the context will be reset on context exit. + Parameters ---------- rc : dict @@ -1089,6 +1092,13 @@ def rc_context(rc=None, fname=None): with mpl.rc_context(fname='print.rc'): plt.plot(x, y) # uses 'print.rc' + Setting in the context body:: + + with mpl.rc_context(): + # will be reset + mpl.rcParams['lines.linewidth'] = 5 + plt.plot(x, y) + """ orig = dict(rcParams.copy()) del orig['backend']
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: