We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6c09a56 + 724387e commit aca6e9dCopy full SHA for aca6e9d
1 file changed
lib/matplotlib/__init__.py
@@ -1071,6 +1071,9 @@ def rc_context(rc=None, fname=None):
1071
1072
The :rc:`backend` will not be reset by the context manager.
1073
1074
+ rcParams changed both through the context manager invocation and
1075
+ in the body of the context will be reset on context exit.
1076
+
1077
Parameters
1078
----------
1079
rc : dict
@@ -1098,6 +1101,13 @@ def rc_context(rc=None, fname=None):
1098
1101
with mpl.rc_context(fname='print.rc'):
1099
1102
plt.plot(x, y) # uses 'print.rc'
1100
1103
1104
+ Setting in the context body::
1105
1106
+ with mpl.rc_context():
1107
+ # will be reset
1108
+ mpl.rcParams['lines.linewidth'] = 5
1109
+ plt.plot(x, y)
1110
1111
"""
1112
orig = dict(rcParams.copy())
1113
del orig['backend']
0 commit comments