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

Skip to content

Commit ff522ae

Browse files
authored
DOC: Improve linkage between rcParams-related documentation (#30948)
1 parent 59a63dd commit ff522ae

3 files changed

Lines changed: 25 additions & 16 deletions

File tree

doc/api/matplotlib_configuration_api.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,24 @@ Default values and styling
2424
==========================
2525

2626
.. py:data:: rcParams
27+
:type: RcParams
28+
29+
The global configuration settings for Matplotlib.
30+
31+
This is a dictionary-like variable that stores the current configuration
32+
settings. Many of the values control styling, but others control
33+
various aspects of Matplotlib's behavior.
34+
35+
See :doc:`/users/explain/configuration` for a full list of config
36+
parameters.
37+
38+
See :ref:`customizing` for usage information.
39+
40+
Notes
41+
-----
42+
This object is also available as ``plt.rcParams`` via the
43+
`matplotlib.pyplot` module (which by convention is imported as ``plt``).
2744

28-
An instance of `RcParams` for handling default Matplotlib values.
2945

3046
.. autoclass:: RcParams
3147
:no-members:

galleries/users_explain/customizing.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
Customizing Matplotlib with style sheets and rcParams
99
=====================================================
1010
11-
Tips for customizing the properties and default styles of Matplotlib.
11+
Many aspects of Matplotlib's behavior and default styles can be customized
12+
through the use of rc (runtime configuration) settings. The current values
13+
are stored in `~matplotlib.rcParams`.
1214
13-
There are three ways to customize Matplotlib:
15+
There are three ways to customize Matplotlib, all of which effectively change
16+
`~matplotlib.rcParams`:
1417
1518
1. :ref:`Setting rcParams at runtime<customizing-with-dynamic-rc-settings>`.
1619
2. :ref:`Using style sheets<customizing-with-style-sheets>`.

lib/matplotlib/__init__.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158

159159
# cbook must import matplotlib only within function
160160
# definitions, so it is safe to import from it here.
161-
from . import _api, _version, cbook, _docstring, rcsetup
161+
from . import _api, _version, cbook, rcsetup
162162
from matplotlib._api import MatplotlibDeprecationWarning
163163
from matplotlib.colors import _color_sequences as color_sequences
164164
from matplotlib.rcsetup import cycler # noqa: F401
@@ -658,23 +658,13 @@ def gen_candidates():
658658
"install is broken")
659659

660660

661-
@_docstring.Substitution(
662-
"\n".join(map("- {}".format, sorted(rcsetup._validators, key=str.lower)))
663-
)
664661
class RcParams(MutableMapping, dict):
665662
"""
666663
A dict-like key-value store for config parameters, including validation.
667664
668-
Validating functions are defined and associated with rc parameters in
669-
:mod:`matplotlib.rcsetup`.
665+
This is the data structure behind `matplotlib.rcParams`.
670666
671-
The list of rcParams is:
672-
673-
%s
674-
675-
See Also
676-
--------
677-
:ref:`customizing-with-matplotlibrc-files`
667+
The complete list of rcParams can be found in :doc:`/users/explain/configuration`.
678668
"""
679669

680670
validate = rcsetup._validators

0 commit comments

Comments
 (0)