Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8d8b1b

Browse files
committed
Merge pull request #6176 from madphysicist/patch-1
DOC: Updated docs for rc_context
2 parents 4230879 + a64686e commit b8d8b1b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/matplotlib/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,15 @@ class rc_context(object):
12851285
plt.plot(x, a)
12861286
12871287
The 'rc' dictionary takes precedence over the settings loaded from
1288-
'fname'. Passing a dictionary only is also valid.
1288+
'fname'. Passing a dictionary only is also valid. For example a
1289+
common usage is::
1290+
1291+
with mpl.rc_context(rc={'interactive': False}):
1292+
fig, ax = plt.subplots()
1293+
ax.plot(range(3), range(3))
1294+
fig.savefig('A.png', format='png')
1295+
plt.close(fig)
1296+
12891297
"""
12901298

12911299
def __init__(self, rc=None, fname=None):

0 commit comments

Comments
 (0)