matplotlib
has a config file and IPython
has its own. Which one has precedence when it comes to setting things like matplotlib
backends?
For example, say my config file for matplotlib
says to use a specific backend, but then I modify my IPython startup or config files to use a different one. Which one would be used when I start IPython and import matplotlib
?
More generally, what is the right way to set things up so that different profiles use different matplotlib
backends or matplotlib configurations?
In modern matplotlib there is no "default backend", i.e. the rcParams['backend'] is set to a "sentinel". Upon importing matplotlib the first working backend from a candidate list ["macosx", "qt5agg", "qt4agg", "gtk3agg", "tkagg", "wxagg"] is chosen.
Matplotlib is a plotting library. It relies on some backend to actually render the plots. The default backend is the agg backend. This backend only renders PNGs. On Jupyter notebooks the matplotlib backends are special as they are rendered to the browser.
IPython configuration is used, as IPython itself chooses the matplotlib backend.
For reference, see IPython:core/pylabtools.py:activate_matplotlib and notice how matplotlib.use(backend)
is called explicitly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With