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):
10801080
10811081 The :rc:`backend` will not be reset by the context manager.
10821082
1083+ rcParams changed both through the context manager invocation and
1084+ in the body of the context will be reset on context exit.
1085+
10831086 Parameters
10841087 ----------
10851088 rc : dict
@@ -1107,6 +1110,13 @@ def rc_context(rc=None, fname=None):
11071110 with mpl.rc_context(fname='print.rc'):
11081111 plt.plot(x, y) # uses 'print.rc'
11091112
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+
11101120 """
11111121 orig = dict (rcParams .copy ())
11121122 del orig ['backend' ]
You can’t perform that action at this time.
0 commit comments