@@ -302,37 +302,41 @@ pygtk, wxpython, tkinter, qt4, or macosx; also referred to as
302
302
"interactive backends") and hardcopy backends to make image files
303
303
(PNG, SVG, PDF, PS; also referred to as "non-interactive backends").
304
304
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:
308
307
309
- backend : WXAgg # use wxpython with antigrain (agg) rendering
308
+ #. The ``backend `` parameter in your ``matplotlibrc `` file (see
309
+ :ref: `customizing-matplotlib `)::
310
310
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
313
312
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::
316
315
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
319
318
320
- > python script.py -dbackend
319
+ #. To set the backend for a single script, you can alternatively use the `-d `
320
+ command line argument::
321
321
322
- You should be aware though that this might conflict with scripts which use the
323
- command line arguments.
322
+ > python script.py -dbackend
324
323
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 >`_).
327
327
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::
330
330
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.
336
340
337
341
.. note ::
338
342
Backend name specifications are not case-sensitive; e.g., 'GTKAgg'
0 commit comments