Matplotlib resorts to Agg no matter what backend I give it.
Things I've tried:
- Changing the backend using matplotlib.use('Qt5Agg') and matplotlib.use('Qt5Agg', force=True)
import matplotlib
matplotlib.use('Qt5Agg', force=True)
import matplotlib.pyplot as plt
- Changing the backend in the matplotlibrc file
## ***************************************************************************
## * BACKENDS *
## ***************************************************************************
## The default backend. If you omit this parameter, the first working
## backend from the following list is used:
## MacOSX Qt5Agg Gtk3Agg TkAgg WxAgg Agg
## Other choices include:
## Qt5Cairo GTK3Cairo TkCairo WxCairo Cairo
## Qt4Agg Qt4Cairo Wx # deprecated.
## PS PDF SVG Template
## You can also deploy your own backend outside of matplotlib by referring to
## the module name (which must be in the PYTHONPATH) as 'module://my_backend'.
#backend: Qt5Agg
Printing the backend gives the following:
print(matplotlib.get_backend())
print(matplotlib.is_interactive())
Qt5Agg
False
Yet when I try to use plt.show() the following error occurs:
UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
plt.show()
I don't know wether this is a Pycharm or Matplotlib error. Hope you guys have any ideas
Shkar
plt.switch_backend('Qt5Agg')before showing the plot.