Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1ea9244

Browse filesBrowse files
committed
DOC: Make style.context and style.use consistent
1 parent 9520eb9 commit 1ea9244
Copy full SHA for 1ea9244

File tree

Expand file treeCollapse file tree

1 file changed

+37
-21
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+37
-21
lines changed

‎lib/matplotlib/style/core.py

Copy file name to clipboardExpand all lines: lib/matplotlib/style/core.py
+37-21Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,31 @@ def use(style):
9191
----------
9292
style : str, dict, Path or list
9393
94-
A style specification.
94+
A style specification. Valid options are:
9595
96-
- If a str, this can be one of the style names in `.style.available`
97-
(a builtin style or a style installed in the user library path).
96+
str
97+
- One of the style names in `.style.available` (a builtin style or
98+
a style installed in the user library path).
9899
99-
This can also be a dotted name of the form "package.style_name"; in
100-
that case, "package" should be an importable Python package name,
101-
e.g. at ``/path/to/package/__init__.py``; the loaded style file is
102-
``/path/to/package/style_name.mplstyle``. (Style files in
103-
subpackages are likewise supported.)
100+
- A dotted name of the form "package.style_name"; in that case,
101+
"package" should be an importable Python package name, e.g. at
102+
``/path/to/package/__init__.py``; the loaded style file is
103+
``/path/to/package/style_name.mplstyle``. (Style files in
104+
subpackages are likewise supported.)
104105
105-
This can also be the path or URL to a style file, which gets loaded
106-
by `.rc_params_from_file`.
106+
- The path or URL to a style file, which gets loaded by
107+
`.rc_params_from_file`.
107108
108-
- If a dict, this is a mapping of key/value pairs for `.rcParams`.
109+
dict
110+
A mapping of key/value pairs for `matplotlib.rcParams`.
109111
110-
- If a Path, this is the path to a style file, which gets loaded by
111-
`.rc_params_from_file`.
112+
Path
113+
The path to a style file, which gets loaded by
114+
`.rc_params_from_file`.
112115
113-
- If a list, this is a list of style specifiers (str, Path or dict),
114-
which get applied from first to last in the list.
116+
list
117+
A list of style specifiers (str, Path or dict), which are applied
118+
from first to last in the list.
115119
116120
Notes
117121
-----
@@ -187,15 +191,27 @@ def context(style, after_reset=False):
187191
A style specification. Valid options are:
188192
189193
str
190-
The name of a style or a path/URL to a style file. For a list of
191-
available style names, see `.style.available`.
194+
- One of the style names in `.style.available` (a builtin style or
195+
a style installed in the user library path).
196+
197+
- A dotted name of the form "package.style_name"; in that case,
198+
"package" should be an importable Python package name, e.g. at
199+
``/path/to/package/__init__.py``; the loaded style file is
200+
``/path/to/package/style_name.mplstyle``. (Style files in
201+
subpackages are likewise supported.)
202+
203+
- The path or URL to a style file, which gets loaded by
204+
`.rc_params_from_file`.
192205
dict
193-
Dictionary with valid key/value pairs for `matplotlib.rcParams`.
206+
A mapping of key/value pairs for `matplotlib.rcParams`.
207+
194208
Path
195-
A path-like object which is a path to a style file.
209+
The path to a style file, which gets loaded by
210+
`.rc_params_from_file`.
211+
196212
list
197-
A list of style specifiers (str, Path or dict) applied from first
198-
to last in the list.
213+
A list of style specifiers (str, Path or dict), which are applied
214+
from first to last in the list.
199215
200216
after_reset : bool
201217
If True, apply style after resetting settings to their defaults;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.