linux
python-2.5.2
matplotlib-0.99.0.tar.gz :http://sourceforge.net/projects/matplotlib/files/matplotlib/
numpy-1.3.0.tar.gz :http://sourceforge.net/projects/numpy/files/NumPy/
scipy-0.11.0.tar.gz :http://sourceforge.net/projects/scipy/files/scipy/0.11.0/
tar zxf numpy-1.3.0.tar.gz
cd numpy-1.3.0
python setup.py build
python setup.py install
tar zxf matplotlib-0.99.0.tar.gz
cd matplotlib-0.99.0
python setup.py build
python setup.py install
最後,matplotlib安裝在 /opt/zhankunlin/python-2.5.2/lib/python2.5/site-packages/目錄下,該目錄是python第三方庫的安裝目錄。
安裝完畢,目錄結構如下:
[root@glnode05 visualization]# ls /opt/python-2.5.2/lib/python2.5/site-packages/
dateutil matplotlib matplotlib-0.99.0-py2.5.egg-info mpl_toolkits numpy numpy-1.3.0-py2.5.egg-info pylab.py pylab.pyc pytz README
( Windows 下下載 exe 檔案安裝即可, 成功後安裝在 D:\Python27\Lib\site-packages\ 目錄下 )
使用:
[root@glnode05 matplotlib]# python
Python 2.5.2 (r252:60911, Apr 7 2012, 22:16:07)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
>>> plt.plot([1,2,3,4], [1,4,9,16], 'ro')
[<matplotlib.lines.Line2D object at 0x12c7050>]
>>> plt.axis([0, 6, 0, 20])
[0, 6, 0, 20]
>>> plt.show()
相關使用以後附上,這裡有一些好的資料:
http://blog.csdn.net/sharkw/article/details/1904302
http://blog.sina.com.cn/s/blog_4b5039210100ie6a.html