Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7290dc1

Browse filesBrowse files
tacaswellFlorianRhiem
authored andcommitted
DOC : edits to copy of usage_faq.rst
Made how to set backend an ordered list
1 parent fffa9c1 commit 7290dc1
Copy full SHA for 7290dc1

File tree

Expand file treeCollapse file tree

1 file changed

+26
-22
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+26
-22
lines changed

‎doc/faq/usage_faq.rst

Copy file name to clipboardExpand all lines: doc/faq/usage_faq.rst
+26-22Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -302,37 +302,41 @@ pygtk, wxpython, tkinter, qt4, or macosx; also referred to as
302302
"interactive backends") and hardcopy backends to make image files
303303
(PNG, SVG, PDF, PS; also referred to as "non-interactive backends").
304304

305-
There are a four ways to configure your backend. One is to set
306-
the ``backend`` parameter in your ``matplotlibrc`` file (see
307-
:ref:`customizing-matplotlib`)::
305+
There are a four ways to configure your backend, in reversed order
306+
of precedence:
308307

309-
backend : WXAgg # use wxpython with antigrain (agg) rendering
308+
#. The ``backend`` parameter in your ``matplotlibrc`` file (see
309+
:ref:`customizing-matplotlib`)::
310310

311-
Another way to do this is setting the :envvar:`MPLBACKEND` environment
312-
variable, either globally or for a single script::
311+
backend : WXAgg # use wxpython with antigrain (agg) rendering
313312

314-
> export MPLBACKEND="module://my_backend"
315-
> python simple_plot.py
313+
#. Setting the :envvar:`MPLBACKEND` environment
314+
variable, either globally or for a single script::
316315

317-
To set the backend for a single script, you can alternatively use the `-d`
318-
command line argument::
316+
> export MPLBACKEND="module://my_backend"
317+
> python simple_plot.py
319318

320-
> python script.py -dbackend
319+
#. To set the backend for a single script, you can alternatively use the `-d`
320+
command line argument::
321321

322-
You should be aware though that this might conflict with scripts which use the
323-
command line arguments.
322+
> python script.py -dbackend
324323

325-
If your script depends on a specific backend you can use the matplotlib
326-
:func:`~matplotlib.use` directive::
324+
This might conflict with scripts which parse
325+
command line arguments (see issue
326+
`#1986 <https://github.com/matplotlib/matplotlib/issues/1986>`_).
327327

328-
import matplotlib
329-
matplotlib.use('PS') # generate postscript output by default
328+
#. If your script depends on a specific backend you can use the
329+
:func:`~matplotlib.use` function::
330330

331-
If you use the ``use`` directive, this must be done before importing
332-
:mod:`matplotlib.pyplot` or :mod:`matplotlib.pylab`. Using this function will
333-
require a change in your code for users who would like to use a different
334-
backend. Therefore you should avoid explicitly calling ``use`` unless
335-
necessary.
331+
import matplotlib
332+
matplotlib.use('PS') # generate postscript output by default
333+
334+
If you use the ``use``, this must be done before importing
335+
:mod:`matplotlib.pyplot`, calling :func:`~matplotlib.use` after pyplot
336+
has been imported will have no effect. Using `use` will
337+
require changes in your code if users want to use a different
338+
backend. Therefore, you should avoid explicitly calling ``use`` unless
339+
absolutely necessary.
336340

337341
.. note::
338342
Backend name specifications are not case-sensitive; e.g., 'GTKAgg'

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.