Matplotlib.Pyplot does not show output; No Error

前端 未结 3 2055
不思量自难忘°
不思量自难忘° 2020-12-16 01:06

My platform is as follows

Centos 6.x (VirtualBox VM running on Win-7 host), Python 2.6.6, Matplotlib 1.3.1, Numpy 1.8.0, Scipy 0.14.0.dev-bb608ba

I am runnin

3条回答
  •  青春惊慌失措
    2020-12-16 01:42

    The first step in debugging this is to replace plt.show() by plt.savefig('foo.png'). If it works, the problem is most probably with the backend:

    >>> import matplotlib
    >>> matplotlib.get_backend()
    'Qt4Agg'
    

    Try switching backends and see if that helps: How to switch backends in matplotlib / Python

    If that does not help either, make sure you have all the dependencies (http://matplotlib.org/users/installing.html) --- I'd just reinstall from source. (not pip install matplotlib)

提交回复
热议问题