UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
how to solve it
UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
how to solve it
You need to set a different backend if you want to use plt.show()
. The Agg
backend can only write plots to files, not show an interactive output.
You set the backend globally by setting the backend
field in your matplotlibrc file (https://matplotlib.org/users/customizing.html#the-matplotlibrc-file).
You can also set the backend from within your program. Just have a look at the page linked above.