From 6a32d35847767e7d1a282b31342a7354a3d4a16e Mon Sep 17 00:00:00 2001 From: Wendell Smith Date: Mon, 8 Jun 2015 14:19:56 -0400 Subject: [PATCH 1/3] Fixed missing grave character --- doc/users/style_sheets.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/style_sheets.rst b/doc/users/style_sheets.rst index 06339961ed92..1c8bb0ba31de 100644 --- a/doc/users/style_sheets.rst +++ b/doc/users/style_sheets.rst @@ -26,7 +26,7 @@ Defining your own style You can create custom styles and use them by calling ``style.use`` with the path or URL to the style sheet. Alternatively, if you add your ``.mplstyle`` -file to ``mpl_configdir/stylelib`, you can reuse your custom style sheet with a call to +file to ``mpl_configdir/stylelib``, you can reuse your custom style sheet with a call to ``style.use()``. By default ``mpl_configdir`` should be ``~/.config/matplotlib``, but you can check where yours is with ``matplotlib.get_configdir()``, you may need to create this directory. Note that a custom style sheet in ``mpl_configdir/stylelib`` From 16a868e4a0357db34f6a3bcfac36990d923f08c0 Mon Sep 17 00:00:00 2001 From: Wendell Smith Date: Mon, 8 Jun 2015 14:32:22 -0400 Subject: [PATCH 2/3] Rearranged the Customization docs: simply switched the two paragraphs --- doc/users/customizing.rst | 55 +++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/doc/users/customizing.rst b/doc/users/customizing.rst index a6b483cca46b..cec768ac9898 100644 --- a/doc/users/customizing.rst +++ b/doc/users/customizing.rst @@ -4,6 +4,33 @@ Customizing matplotlib ********************** +.. _customizing-with-dynamic-rc-settings: + +Dynamic rc settings +=================== + +You can also dynamically change the default rc settings in a python script or +interactively from the python shell. All of the rc settings are stored in a +dictionary-like variable called :data:`matplotlib.rcParams`, which is global to +the matplotlib package. rcParams can be modified directly, for example:: + + import matplotlib as mpl + mpl.rcParams['lines.linewidth'] = 2 + mpl.rcParams['lines.color'] = 'r' + +Matplotlib also provides a couple of convenience functions for modifying rc +settings. The :func:`matplotlib.rc` command can be used to modify multiple +settings in a single group at once, using keyword arguments:: + + import matplotlib as mpl + mpl.rc('lines', linewidth=2, color='r') + +The :func:`matplotlib.rcdefaults` command will restore the standard matplotlib +default settings. + +There is some degree of validation when setting the values of rcParams, see +:mod:`matplotlib.rcsetup` for details. + .. _customizing-with-matplotlibrc-files: The :file:`matplotlibrc` file @@ -46,34 +73,6 @@ loaded from, one can do the following:: See below for a sample :ref:`matplotlibrc file`. -.. _customizing-with-dynamic-rc-settings: - -Dynamic rc settings -=================== - -You can also dynamically change the default rc settings in a python script or -interactively from the python shell. All of the rc settings are stored in a -dictionary-like variable called :data:`matplotlib.rcParams`, which is global to -the matplotlib package. rcParams can be modified directly, for example:: - - import matplotlib as mpl - mpl.rcParams['lines.linewidth'] = 2 - mpl.rcParams['lines.color'] = 'r' - -Matplotlib also provides a couple of convenience functions for modifying rc -settings. The :func:`matplotlib.rc` command can be used to modify multiple -settings in a single group at once, using keyword arguments:: - - import matplotlib as mpl - mpl.rc('lines', linewidth=2, color='r') - -The :func:`matplotlib.rcdefaults` command will restore the standard matplotlib -default settings. - -There is some degree of validation when setting the values of rcParams, see -:mod:`matplotlib.rcsetup` for details. - - .. _matplotlibrc-sample: A sample matplotlibrc file From c6c4cf6666ba1d1cf2f38ee81e314bbbc31ccb72 Mon Sep 17 00:00:00 2001 From: Wendell Smith Date: Mon, 8 Jun 2015 14:33:18 -0400 Subject: [PATCH 3/3] Added paragraph on style sheets to Customization section --- doc/users/customizing.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/users/customizing.rst b/doc/users/customizing.rst index cec768ac9898..7388224f51d0 100644 --- a/doc/users/customizing.rst +++ b/doc/users/customizing.rst @@ -4,6 +4,16 @@ Customizing matplotlib ********************** +Using style sheets +================== + +Style sheets provide a means for more specific and/or temporary configuration +modifications, but in a repeatable and well-ordered manner. A style sheet is a +file with the same syntax as the :file:`matplotlibrc` file, and when applied, it +will override the :file:`matplotlibrc`. + +For more information and examples, see :ref:`style-sheets`. + .. _customizing-with-dynamic-rc-settings: Dynamic rc settings