From e8f609ab59b74cb657660412926831c1ea36e74d Mon Sep 17 00:00:00 2001 From: Phil Ruffwind Date: Thu, 20 Apr 2017 04:40:30 -0400 Subject: [PATCH] Discourage omitting backend in matplotlibrc This can lead to unexpected behavior as matplotlib defaults to a non-interactive backend. --- doc/users/customizing.rst | 9 +++++++++ matplotlibrc.template | 3 +++ 2 files changed, 12 insertions(+) diff --git a/doc/users/customizing.rst b/doc/users/customizing.rst index ccfb6c222ba7..42b0216fea29 100644 --- a/doc/users/customizing.rst +++ b/doc/users/customizing.rst @@ -156,6 +156,9 @@ locations, in the following order: your customizations to be saved, please move this file to your user-specific matplotlib directory. +Once a :file:`matplotlibrc` file has been found, it will *not* search any of +the other paths. + To display where the currently active :file:`matplotlibrc` file was loaded from, one can do the following:: @@ -164,6 +167,12 @@ loaded from, one can do the following:: '/home/foo/.config/matplotlib/matplotlibrc' See below for a sample :ref:`matplotlibrc file`. +Although all parameters are optional, you should almost always set the +`backend` or else matplotlib will choose `Agg`, a *non-interactive* backend. +This can lead to unexpected behavior, since if you do not have a +:file:`matplotlibrc` file, it would normally fall back to +:file:`{INSTALL}/matplotlib/mpl-data/matplotlibrc`, which is often set to an +interactive backend by the package maintainer. .. _matplotlibrc-sample: diff --git a/matplotlibrc.template b/matplotlibrc.template index 9515ab646a30..2f0e5c473891 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -35,6 +35,9 @@ # You can also deploy your own backend outside of matplotlib by # referring to the module name (which must be in the PYTHONPATH) as # 'module://my_backend'. +# +# If you omit this parameter, it will always default to "Agg", which is a +# non-interactive backend. backend : $TEMPLATE_BACKEND # If you are using the Qt4Agg backend, you can choose here