File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1071,6 +1071,9 @@ def rc_context(rc=None, fname=None):
1071
1071
1072
1072
The :rc:`backend` will not be reset by the context manager.
1073
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
+
1074
1077
Parameters
1075
1078
----------
1076
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
+
1101
1111
"""
1102
1112
orig = dict (rcParams .copy ())
1103
1113
del orig ['backend' ]
You can’t perform that action at this time.
0 commit comments