diff --git a/doc/api/style_api.rst b/doc/api/style_api.rst index 1f124965da61..0900bf46cc75 100644 --- a/doc/api/style_api.rst +++ b/doc/api/style_api.rst @@ -20,13 +20,13 @@ the builtin styles. .. imported variables have to be specified explicitly due to https://github.com/sphinx-doc/sphinx/issues/6607 -.. data:: matplotlib.style.library +.. data:: library - A dict mapping from style name to `.RcParams` defining that style. + A dict mapping from style name to `.rcParams` defining that style. This is meant to be read-only. Use `.reload_library` to update. -.. data:: matplotlib.style.available +.. data:: available List of the names of the available styles. diff --git a/galleries/examples/style_sheets/style_sheets_reference.py b/galleries/examples/style_sheets/style_sheets_reference.py index 7a479a9644eb..43b9c4f941ee 100644 --- a/galleries/examples/style_sheets/style_sheets_reference.py +++ b/galleries/examples/style_sheets/style_sheets_reference.py @@ -5,8 +5,19 @@ This script demonstrates the different available style sheets on a common set of example plots: scatter plot, image, bar graph, patches, -line plot and histogram, +line plot and histogram. +Any of these style sheets can be imported (i.e. activated) by its name. +For example for the ggplot style: + +>>> plt.style.use('ggplot') + +The names of the available style sheets can be found +in the list `matplotlib.style.available` +(they are also printed in the corner of each plot below). + +See more details in :ref:`Customizing Matplotlib +using style sheets`. """ import matplotlib.pyplot as plt