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 @@ -1080,6 +1080,9 @@ def rc_context(rc=None, fname=None):
1080
1080
1081
1081
The :rc:`backend` will not be reset by the context manager.
1082
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
+
1083
1086
Parameters
1084
1087
----------
1085
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
+
1110
1120
"""
1111
1121
orig = dict (rcParams .copy ())
1112
1122
del orig ['backend' ]
You can’t perform that action at this time.
0 commit comments