python使用matplotlib 以及matplotlib安装绘图(window7)

matplotlib主页:http://matplotlib.org/index.html html

安装文档:http://matplotlib.org/users/installing.html python

本人参见:DanielWang的博客,使用python Matplotlib库绘图 web

安装步骤:

  1. 安装Python:

       这个网上不少,也很简单, 就不在这里说了.也能够去看看我另外一篇博客.(转载的)测试

 2.   安装numpy 和 scipy

           请参见我上一篇博客:点击这里ui

  3.    安装matplotlibspa

        下载地址:http://sourceforge.net/projects/matplotlib/files/matplotlib/ , 下载完了就安装,会本身找到python的安装路径. 装完了以后,测试一下.net

import matplotlib.pyplot as plt

 

不出现错误就是安装好了.code

  4.    下面运行一个简单的例子orm

import matplotlib.pyplot as plt 
  
plt.bar(left = 0,height = 1)
plt.show()

    发现出现了下面的错误:htm

     raise ImportError("matplotlib requires dateutil")
     ImportError: matplotlib requires dateutil

     这个须要dateutil,你能够到这里下载安装。

     把dateutil 安装完后又出现以下错误:

     raise ImportError("matplotlib requires pyparsing")
     ImportError: matplotlib requires pyparsing

     须要 pyparsing  到这里下载安装.

            完成以上步骤,运行上面的例子就能够显示咱们的图像,以下所示。

若是出现上面画面, 说明成功了.

可是并非每一个人都这么幸运的, 你可能会出现这个错误:ImportError: No module named six 

解决这个错误,请参见我下一篇博客.python错误:No module named six

相关文章
相关标签/搜索