The current backend name is accessible via
>>> import matplotlib.pyplot as plt >>> plt.get_backend() 'GTKAgg'
Is there a way to get a list of all backends that can be used on a particular machine?
To check that pylab/pyplot backend of Matplotlib runs inline, we can use get_backend() method. The method returns the name of the current backend.
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.
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.
You can access the lists
matplotlib.rcsetup.interactive_bk matplotlib.rcsetup.non_interactive_bk matplotlib.rcsetup.all_backends
the third being the concatenation of the former two. If I read the source code correctly, those lists are hard-coded though, and don't tell you what backends are actually usable. There is also
matplotlib.rcsetup.validate_backend(name)
but this also only checks against the hard-coded list.
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