From d6df54fa74cb40ffe34bb08ab32fdae0d405c51f Mon Sep 17 00:00:00 2001 From: Pierre Haessig Date: Mon, 26 Jun 2023 17:00:50 +0200 Subject: [PATCH 1/4] link style sheets reference to customization tutorial --- .../examples/style_sheets/style_sheets_reference.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/galleries/examples/style_sheets/style_sheets_reference.py b/galleries/examples/style_sheets/style_sheets_reference.py index 7a479a9644eb..0922c8e6791a 100644 --- a/galleries/examples/style_sheets/style_sheets_reference.py +++ b/galleries/examples/style_sheets/style_sheets_reference.py @@ -5,8 +5,15 @@ 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 with: + +>>> plt.style.use('ggplot') + +while name of the available style sheets (printed in corner of the plots below) can be found in the list `matplotlib.style.available`. + +See more details in :ref:`Customizing Matplotlib using style sheets`. """ import matplotlib.pyplot as plt From 69e19edbb2b6a082dc613034a642098b269bda2e Mon Sep 17 00:00:00 2001 From: Pierre Haessig Date: Mon, 26 Jun 2023 17:21:21 +0200 Subject: [PATCH 2/4] fix type and line length --- galleries/examples/style_sheets/style_sheets_reference.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/galleries/examples/style_sheets/style_sheets_reference.py b/galleries/examples/style_sheets/style_sheets_reference.py index 0922c8e6791a..fe3f06b88f99 100644 --- a/galleries/examples/style_sheets/style_sheets_reference.py +++ b/galleries/examples/style_sheets/style_sheets_reference.py @@ -7,11 +7,14 @@ common set of example plots: scatter plot, image, bar graph, patches, line plot and histogram. -Any of these style sheets can be imported (i.e. activated) by its name with: +Any of these style sheets can be imported (i.e. activated) by its name. +For example for the ggplot style: >>> plt.style.use('ggplot') -while name of the available style sheets (printed in corner of the plots below) can be found in the list `matplotlib.style.available`. +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`. """ From 79841009624f1fa56c2fd5595abee819e4ea2605 Mon Sep 17 00:00:00 2001 From: Pierre Haessig Date: Wed, 28 Jun 2023 10:45:19 +0200 Subject: [PATCH 3/4] cut long line --- galleries/examples/style_sheets/style_sheets_reference.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/galleries/examples/style_sheets/style_sheets_reference.py b/galleries/examples/style_sheets/style_sheets_reference.py index fe3f06b88f99..43b9c4f941ee 100644 --- a/galleries/examples/style_sheets/style_sheets_reference.py +++ b/galleries/examples/style_sheets/style_sheets_reference.py @@ -16,7 +16,8 @@ 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`. +See more details in :ref:`Customizing Matplotlib +using style sheets`. """ import matplotlib.pyplot as plt From f8269835e9705f409549c1baf40e3d1c61983a07 Mon Sep 17 00:00:00 2001 From: Pierre Haessig Date: Fri, 30 Jun 2023 09:01:17 +0200 Subject: [PATCH 4/4] fix directive for matplotlib.style data + fix typo "RcParams" --- doc/api/style_api.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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.