File tree 2 files changed +24
-6
lines changed
2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 2
2
``matplotlib.style ``
3
3
********************
4
4
5
- .. seealso ::
5
+ Styles are predefined sets of `.rcParams ` that define the visual appearance of
6
+ a plot.
6
7
7
- Examples of using style sheets with :func: `matplotlib.style.use ` can be found at :doc: `/gallery/style_sheets/style_sheets_reference `.
8
+ :doc: `/tutorials/introductory/customizing ` describes the mechanism and usage
9
+ of styles.
10
+
11
+ The :doc: `/gallery/style_sheets/style_sheets_reference ` gives an overview of
12
+ the builtin styles.
8
13
9
14
.. automodule :: matplotlib.style
10
15
:members:
11
16
:undoc-members:
12
17
:show-inheritance:
13
18
:imported-members:
14
19
20
+ .. imported variables have to be specified explicitly due to
21
+ https://github.com/sphinx-doc/sphinx/issues/6607
22
+
15
23
.. data :: matplotlib.style.library
16
24
17
- Dictionary of available styles
25
+ A dict mapping from style name to `.RcParams ` defining that style.
26
+
27
+ This is meant to be read-only. Use `.reload_library ` to update.
18
28
19
29
.. data :: matplotlib.style.available
20
30
21
- List of available styles
31
+ List of the names of the available styles.
32
+
33
+ This is meant to be read-only. Use `.reload_library ` to update.
Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ def use(style):
70
70
The style name of 'default' is reserved for reverting back to
71
71
the default style settings.
72
72
73
+ .. note::
74
+
75
+ This updates the `.rcParams` with the settings from the style.
76
+ `.rcParams` not defined in the style are kept.
77
+
73
78
Parameters
74
79
----------
75
80
style : str, dict, Path or list
@@ -167,7 +172,7 @@ def iter_user_libraries():
167
172
168
173
169
174
def update_user_library (library ):
170
- """Update style library with user-defined rc files"""
175
+ """Update style library with user-defined rc files. """
171
176
for stylelib_path in iter_user_libraries ():
172
177
styles = read_style_directory (stylelib_path )
173
178
update_nested_dict (library , styles )
@@ -215,11 +220,12 @@ def update_nested_dict(main_dict, new_dict):
215
220
_base_library = load_base_library ()
216
221
217
222
library = None
223
+
218
224
available = []
219
225
220
226
221
227
def reload_library ():
222
- """Reload style library."""
228
+ """Reload the style library."""
223
229
global library
224
230
library = update_user_library (_base_library )
225
231
available [:] = sorted (library .keys ())
You can’t perform that action at this time.
0 commit comments