Skip to content

Commit e8a4328

Browse files
committed
Clarify docs for rcdefaults and friends.
1 parent e388666 commit e8a4328

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

lib/matplotlib/__init__.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,9 +1206,9 @@ def rc(group, **kwargs):
12061206
12071207
rc('font', **font) # pass in the font dict as kwargs
12081208
1209-
This enables you to easily switch between several configurations.
1210-
Use :func:`~matplotlib.pyplot.rcdefaults` to restore the default
1211-
rc params after changes.
1209+
This enables you to easily switch between several configurations. Use
1210+
``matplotlib.style.use('default')`` or :func:`~matplotlib.rcdefaults` to
1211+
restore the default rc params after changes.
12121212
"""
12131213

12141214
aliases = {
@@ -1235,15 +1235,26 @@ def rc(group, **kwargs):
12351235

12361236

12371237
def rcdefaults():
1238-
"""
1239-
Restore the default rc params. These are not the params loaded by
1240-
the rc file, but mpl's internal params. See rc_file_defaults for
1241-
reloading the default params from the rc file
1238+
"""Restore the rc params from Matplotlib's internal defaults.
1239+
1240+
See Also
1241+
--------
1242+
rc_file_defaults :
1243+
Restore the rc params from the rc file originally loaded by Matplotlib.
1244+
matplotlib.style.use :
1245+
Use a specific style file. Call ``style.use('default')`` to restore
1246+
the default style.
12421247
"""
12431248
rcParams.clear()
12441249
rcParams.update(rcParamsDefault)
12451250

12461251

1252+
def rc_file_defaults():
1253+
"""Restore the rc params from the original rc file loaded by Matplotlib.
1254+
"""
1255+
rcParams.update(rcParamsOrig)
1256+
1257+
12471258
def rc_file(fname):
12481259
"""
12491260
Update rc params from file.
@@ -1306,14 +1317,6 @@ def __exit__(self, type, value, tb):
13061317
rcParams.update(self._rcparams)
13071318

13081319

1309-
def rc_file_defaults():
1310-
"""
1311-
Restore the default rc params from the original matplotlib rc that
1312-
was loaded
1313-
"""
1314-
rcParams.update(rcParamsOrig)
1315-
1316-
13171320
_use_error_msg = """
13181321
This call to matplotlib.use() has no effect because the backend has already
13191322
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,

0 commit comments

Comments
 (0)