8000 Clarify docs for rcdefaults and friends. by anntzer · Pull Request #8526 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Clarify docs for rcdefaults and friends. #8526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,9 +1206,9 @@ def rc(group, **kwargs):

rc('font', **font) # pass in the font dict as kwargs

This enables you to easily switch between several configurations.
Use :func:`~matplotlib.pyplot.rcdefaults` to restore the default
rc params after changes.
This enables you to easily switch between several configurations. Use
``matplotlib.style.use('default')`` or :func:`~matplotlib.rcdefaults` to
restore the default rc params after changes.
"""

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


def rcdefaults():
"""
Restore the default rc params. These are not the params loaded by
the rc file, but mpl's internal params. See rc_file_defaults for
reloading the default params from the rc file
"""Restore the rc params from Matplotlib's internal defaults.

See Also
--------
rc_file_defaults :
Restore the rc params from the rc file originally loaded by Matplotlib.
matplotlib.style.use :
Use a specific style file. Call ``style.use('default')`` to restore
the default style.
"""
rcParams.clear()
rcParams.update(rcParamsDefault)


def rc_file_defaults():
"""Restore the rc params from the original rc file loaded by Matplotlib.
"""
rcParams.update(rcParamsOrig)


def rc_file(fname):
"""
Update rc params from file.
Expand Down Expand Up @@ -1306,14 +1317,6 @@ def __exit__(self, type, value, tb):
rcParams.update(self._rcparams)


def rc_file_defaults():
"""
Restore the default rc params from the original matplotlib rc that
was loaded
"""
rcParams.update(rcParamsOrig)


_use_error_msg = """
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
Expand Down
0