I am using spyder 4 in anaconda, everything was fine, I could plot graph in the "plot window" with plt.show()
However, I got the error as following since yesterday and I have now idea why.
'Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.' I have checked the file "matplotlibrc" and it should be using "tkagg" as default backend. And I am pretty sure the tkinder is installed.
import numpy as np
import matplotlib
#matplotlib.use('tkagg')
import tkinter
import matplotlib.pyplot as plt
import pandas as pd
x = np.linspace(0, 100, 11)
y = np.linspace(0, 100, 11)
plt.plot(x, y)
plt.show()
# fig.savefig(show.png)
The backend error The pops up window and hang
I look on the internet and some said to add the line ' matplotlib.use('tkagg') ' . If I run the code then a small window pops up and just hang there with no response.
Anyone could point me to a right direction. All I want to do is to show the plot in the "plot window"
Thanks in advance.