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 @@ -1062,6 +1062,9 @@ def rc_context(rc=None, fname=None):
1062
1062
1063
1063
The :rc:`backend` will not be reset by the context manager.
1064
1064
1065
+ rcParams changed both through the context manager invocation and
1066
+ in the body of the context will be reset on context exit.
1067
+
1065
1068
Parameters
1066
1069
----------
1067
1070
rc : dict
@@ -1089,6 +1092,13 @@ def rc_context(rc=None, fname=None):
1089
1092
with mpl.rc_context(fname='print.rc'):
1090
1093
plt.plot(x, y) # uses 'print.rc'
1091
1094
1095
+ Setting in the context body::
1096
+
1097
+ with mpl.rc_context():
1098
+ # will be reset
1099
+ mpl.rcParams['lines.linewidth'] = 5
1100
+ plt.plot(x, y)
1101
+
1092
1102
"""
1093
1103
orig = dict (rcParams .copy ())
1094
1104
del orig ['backend' ]
You can’t perform that action at this time.
0 commit comments