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):
10711071
10721072 The :rc:`backend` will not be reset by the context manager.
10731073
1074+ rcParams changed both through the context manager invocation and
1075+ in the body of the context will be reset on context exit.
1076+
10741077 Parameters
10751078 ----------
10761079 rc : dict
@@ -1098,6 +1101,13 @@ def rc_context(rc=None, fname=None):
10981101 with mpl.rc_context(fname='print.rc'):
10991102 plt.plot(x, y) # uses 'print.rc'
11001103
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+
11011111 """
11021112 orig = dict (rcParams .copy ())
11031113 del orig ['backend' ]
You can’t perform that action at this time.
0 commit comments