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

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

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

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

安装步骤:

  1. 安装Python:

       这个网上很多,也很简单, 就不在这里说了.也可以去看看我另一篇博客.(转载的)

 2.   安装numpy 和 scipy

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

  3.    安装matplotlib

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

import matplotlib.pyplot as plt

 

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

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

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

    发现出现了下面的错误:

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

     这个需要dateutil,你可以到这里下载安装。

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

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

     需要 pyparsing  到这里下载安装.

            完成以上步骤,运行上面的例子就可以显示我们的图像,如下所示。

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

如果出现上面画面, 说明成功了.

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

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

你可能感兴趣的:(安装,python,错误,DateUtil,matplotlib,pyparsing)