Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e8f609a

Browse files
committed
Discourage omitting backend in matplotlibrc
This can lead to unexpected behavior as matplotlib defaults to a non-interactive backend.
1 parent 791b281 commit e8f609a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

doc/users/customizing.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ locations, in the following order:
156156
your customizations to be saved, please move this file to your
157157
user-specific matplotlib directory.
158158

159+
Once a :file:`matplotlibrc` file has been found, it will *not* search any of
160+
the other paths.
161+
159162
To display where the currently active :file:`matplotlibrc` file was
160163
loaded from, one can do the following::
161164

@@ -164,6 +167,12 @@ loaded from, one can do the following::
164167
'/home/foo/.config/matplotlib/matplotlibrc'
165168

166169
See below for a sample :ref:`matplotlibrc file<matplotlibrc-sample>`.
170+
Although all parameters are optional, you should almost always set the
171+
`backend` or else matplotlib will choose `Agg`, a *non-interactive* backend.
172+
This can lead to unexpected behavior, since if you do not have a
173+
:file:`matplotlibrc` file, it would normally fall back to
174+
:file:`{INSTALL}/matplotlib/mpl-data/matplotlibrc`, which is often set to an
175+
interactive backend by the package maintainer.
167176

168177
.. _matplotlibrc-sample:
169178

matplotlibrc.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
# You can also deploy your own backend outside of matplotlib by
3636
# referring to the module name (which must be in the PYTHONPATH) as
3737
# 'module://my_backend'.
38+
#
39+
# If you omit this parameter, it will always default to "Agg", which is a
40+
# non-interactive backend.
3841
backend : $TEMPLATE_BACKEND
3942

4043
# If you are using the Qt4Agg backend, you can choose here

0 commit comments

Comments
 (0)