We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8b9eb4 commit 724387eCopy full SHA for 724387e
1 file changed
lib/matplotlib/__init__.py
@@ -1080,6 +1080,9 @@ def rc_context(rc=None, fname=None):
1080
1081
The :rc:`backend` will not be reset by the context manager.
1082
1083
+ rcParams changed both through the context manager invocation and
1084
+ in the body of the context will be reset on context exit.
1085
+
1086
Parameters
1087
----------
1088
rc : dict
@@ -1107,6 +1110,13 @@ def rc_context(rc=None, fname=None):
1107
1110
with mpl.rc_context(fname='print.rc'):
1108
1111
plt.plot(x, y) # uses 'print.rc'
1109
1112
1113
+ Setting in the context body::
1114
1115
+ with mpl.rc_context():
1116
+ # will be reset
1117
+ mpl.rcParams['lines.linewidth'] = 5
1118
+ plt.plot(x, y)
1119
1120
"""
1121
orig = dict(rcParams.copy())
1122
del orig['backend']
0 commit comments