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):
10621062
10631063 The :rc:`backend` will not be reset by the context manager.
10641064
1065+ rcParams changed both through the context manager invocation and
1066+ in the body of the context will be reset on context exit.
1067+
10651068 Parameters
10661069 ----------
10671070 rc : dict
@@ -1089,6 +1092,13 @@ def rc_context(rc=None, fname=None):
10891092 with mpl.rc_context(fname='print.rc'):
10901093 plt.plot(x, y) # uses 'print.rc'
10911094
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+
10921102 """
10931103 orig = dict (rcParams .copy ())
10941104 del orig ['backend' ]
You can’t perform that action at this time.
0 commit comments