Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaca6e9d

Browse files
authored
Merge pull request#24354 from tacaswell/doc_rccontext
DOC: clarify rc_context resets all rcParams changes
2 parents6c09a56 +724387e commitaca6e9d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎lib/matplotlib/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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
delorig['backend']

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp