-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
allow selecting the backend by setting the environment variable MPLBACKEND #3710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0d995d4
allow selecting the backend by setting the environment variable MPL_B…
FlorianRhiem 0ead4b2
added documentation on backend selection methods
FlorianRhiem fffa9c1
minor fix for the documentation on backend selection methods (either …
FlorianRhiem 7290dc1
DOC : edits to copy of usage_faq.rst
tacaswell 0042453
Added a warning about global use of MPLBACKEND or use of -dbackend
FlorianRhiem 40e4019
Added mplDeprecation warning when the -d argument is used. Minor impr…
FlorianRhiem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Added mplDeprecation warning when the -d argument is used. Minor impr…
…ovements to the backend selection documentation.
- Loading branch information
commit 40e40193b37d14afbbac7093a552dbb7d021250e
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,8 +302,10 @@ pygtk, wxpython, tkinter, qt4, or macosx; also referred to as | |
"interactive backends") and hardcopy backends to make image files | ||
(PNG, SVG, PDF, PS; also referred to as "non-interactive backends"). | ||
|
||
There are a four ways to configure your backend, in reversed order | ||
of precedence: | ||
There are a four ways to configure your backend. If they conflict each other, | ||
the method mentioned last in the following list will be used, e.g. calling | ||
:func:`~matplotlib.use()` will override the setting in your ``matplotlibrc``. | ||
|
||
|
||
#. The ``backend`` parameter in your ``matplotlibrc`` file (see | ||
:ref:`customizing-matplotlib`):: | ||
|
@@ -329,9 +331,9 @@ of precedence: | |
|
||
> python script.py -dbackend | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space |
||
|
||
This might conflict with scripts which parse | ||
command line arguments (see issue | ||
`#1986 <https://github.com/matplotlib/matplotlib/issues/1986>`_), so you | ||
This method is **deprecated** as the `-d` argument might conflict with | ||
scripts which parse command line arguments (see issue | ||
`#1986 <https://github.com/matplotlib/matplotlib/issues/1986>`_). You | ||
should use :envvar:`MPLBACKEND` instead. | ||
|
||
#. If your script depends on a specific backend you can use the | ||
|
@@ -340,12 +342,12 @@ of precedence: | |
import matplotlib | ||
matplotlib.use('PS') # generate postscript output by default | ||
|
||
If you use the ``use``, this must be done before importing | ||
:mod:`matplotlib.pyplot`, calling :func:`~matplotlib.use` after pyplot | ||
has been imported will have no effect. Using `use` will | ||
require changes in your code if users want to use a different | ||
backend. Therefore, you should avoid explicitly calling ``use`` unless | ||
absolutely necessary. | ||
If you use the :func:`~matplotlib.use` function, this must be done before | ||
importing :mod:`matplotlib.pyplot`. Calling :func:`~matplotlib.use` after | ||
pyplot has been imported will have no effect. Using | ||
:func:`~matplotlib.use` will require changes in your code if users want to | ||
use a different backend. Therefore, you should avoid explicitly calling | ||
:func:`~matplotlib.use` unless absolutely necessary. | ||
|
||
.. note:: | ||
Backend name specifications are not case-sensitive; e.g., 'GTKAgg' | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you put the space back in there? These docs are for reading, not typing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code, now I wonder if it ever worked with the space in there...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WeatherGod At least it does not work with module-backends, because the argument without the first two characters is passed to
use()
anduse()
containsarg.startswith('module://')
without a previous.strip()
call.