Python:使用matplotlib绘制图表

   今天看了一下使用python绘制图表的方法,有个强大的类库matplotlib,可以制作出高质量的2D和3D图形,先记录一下,以后慢慢学习。

   matplotlib下载及API手册地址:http://sourceforge.net/projects/matplotlib/files/matplotlib/

   数学库numpy下载及API手册地址:http://www.scipy.org/Download

   几个绘图的例子,来自API手册:

1、最简单的图:

代码:

测试:

2.饼图:

代码:


测试:

 

3、使用numpy库函数:

代码:

测试:



 

  

posted @ 2012-02-27 00:17  Socrates  阅读(562)  评论(0编辑  收藏  举报