matplotlib.style

See also

Examples of using style sheets with matplotlib.style.use() can be found at Style sheets reference.

matplotlib.style.context(style, after_reset=False)[source]

Context manager for using style settings temporarily.

Parameters:
stylestr, dict, Path or list

A style specification. Valid options are:

str The name of a style or a path/URL to a style file. For a list of available style names, see style.available.
dict Dictionary with valid key/value pairs for matplotlib.rcParams.
Path A path-like object which is a path to a style file.
list A list of style specifiers (str, Path or dict) applied from first to last in the list.
after_resetbool

If True, apply style after resetting settings to their defaults; otherwise, apply style on top of the current settings.

matplotlib.style.reload_library()[source]

Reload style library.

matplotlib.style.use(style)[source]

Use matplotlib style settings from a style specification.

The style name of 'default' is reserved for reverting back to the default style settings.

Parameters:
stylestr, dict, Path or list

A style specification. Valid options are:

str The name of a style or a path/URL to a style file. For a list of available style names, see style.available.
dict Dictionary with valid key/value pairs for matplotlib.rcParams.
Path A path-like object which is a path to a style file.
list A list of style specifiers (str, Path or dict) applied from first to last in the list.
matplotlib.style.library

Dictionary of available styles

matplotlib.style.available

List of available styles