Python under the drawing, but did not draw out, because the Matplotlib display mode is agg, Tkagg can be installed matplotlib
sudo zypper install matplotlib
example of a problem:
>>> import Matplotlib.pyplot as plt
>>> x = [1,2,3,4,5]
>>> y = [1,4,9,16,25]
>>> Plt.plot (x,y)
>>> plt.show ()
But there is no map to make, there is no error, out[4]: [
>>> from Matplotlib.pyplot import savefig
>>> savefig (' save.png ')
I got the graph I wanted in the current directory, which means matplotlib is fine, but MATPLOTLIB-TK does not invoke and display the solution:
To view the location of the backend configuration file:
Matplotlib.matplotlib_fname ()
My computer is on the path
/usr/lib64/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc
To open a configuration file:
sudo vi/usr/lib64/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc
Approximately 38 lines in the position are:
Backend : Agg
Change it to read:
Backend : Tkagg
can be displayed
Reference: https://forum.suse.org.cn/viewtopic.php?f=24&t=2258