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 @@ -71,6 +71,11 @@ def use(style):
71
71
The style name of 'default' is reserved for reverting back to
72
72
the default style settings.
73
73
74
+ .. note::
75
+
76
+ This updates the `.rcParams` with the settings from the style.
77
+ `.rcParams` not defined in the style are kept.
78
+
74
79
Parameters
75
80
----------
76
81
style : str, dict, Path or list
@@ -168,7 +173,7 @@ def iter_user_libraries():
168
173
169
174
170
175
def update_user_library (library ):
171
- """Update style library with user-defined rc files"""
176
+ """Update style library with user-defined rc files. """
172
177
for stylelib_path in iter_user_libraries ():
173
178
styles = read_style_directory (stylelib_path )
174
179
update_nested_dict (library , styles )
@@ -216,11 +221,12 @@ def update_nested_dict(main_dict, new_dict):
216
221
_base_library = load_base_library ()
217
222
218
223
library = None
224
+
219
225
available = []
220
226
221
227
222
228
def reload_library ():
223
- """Reload style library."""
229
+ """Reload the style library."""
224
230
global library
225
231
library = update_user_library (_base_library )
226
232
available [:] = sorted (library .keys ())
You can’t perform that action at this time.
0 commit comments