调试的第一步是将其替换
plt.show()为
plt.savefig('foo.png')。如果可行,则问题很可能与后端有关:>>> import matplotlib>>> matplotlib.get_backend()'Qt4Agg'
如果那也无济于事,请确保您具有所有依赖项(http://matplotlib.org/users/installing.html)---我只是从源代码重新安装。(
不是
pip install matplotlib)

调试的第一步是将其替换
plt.show()为
plt.savefig('foo.png')。如果可行,则问题很可能与后端有关:>>> import matplotlib>>> matplotlib.get_backend()'Qt4Agg'
如果那也无济于事,请确保您具有所有依赖项(http://matplotlib.org/users/installing.html)---我只是从源代码重新安装。(
不是
pip install matplotlib)