Skip to content

Commit

Permalink
Added a warning about global use of MPLBACKEND or use of -dbackend
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRhiem committed Nov 18, 2014
1 parent 7290dc1 commit 0042453
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions doc/faq/usage_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,19 +311,28 @@ of precedence:
backend : WXAgg # use wxpython with antigrain (agg) rendering

#. Setting the :envvar:`MPLBACKEND` environment
variable, either globally or for a single script::
variable, either for your current shell or for a single script::

> export MPLBACKEND="module://my_backend"
> python simple_plot.py

> MPLBACKEND="module://my_backend" python simple_plot.py

Setting this environment variable will override the ``backend`` parameter
in *any* ``matplotlibrc``, even if there is a ``matplotlibrc`` in your
current working directory. Therefore setting :envvar:`MPLBACKEND`
globally, e.g. in your ``.bashrc`` or ``.profile``, is discouraged as it
might lead to counter-intuitive behavior.

#. To set the backend for a single script, you can alternatively use the `-d`
command line argument::

> python script.py -dbackend

This might conflict with scripts which parse
command line arguments (see issue
`#1986 <https://github.com/matplotlib/matplotlib/issues/1986>`_).
`#1986 <https://github.com/matplotlib/matplotlib/issues/1986>`_), so you
should use :envvar:`MPLBACKEND` instead.

#. If your script depends on a specific backend you can use the
:func:`~matplotlib.use` function::
Expand Down

0 comments on commit 0042453

Please sign in to comment.