Homepage
Http://matplotlib.org/index.html
Install
#sudo Yum Install Python-matplotlib
has been installed:
Python-matplotlib.x86_64 0:1.2.0-15.EL7
To be installed as a dependency:
Agg.x86_64 0:2.5-18.EL7
Atlas.x86_64 0:3.10.1-10.EL7
Blas.x86_64 0:3.4.2-5.EL7
Lapack.x86_64 0:3.4.2-5.EL7
Libgfortran.x86_64 0:4.8.5-4.EL7
Libquadmath.x86_64 0:4.8.5-4.EL7
Numpy.x86_64 1:1.7.1-11.EL7
Python-nose.noarch 0:1.3.0-3.EL7
T1lib.x86_64 0:5.1.2-14.EL7
Texlive-base.noarch 2:2012-38.20130427_R30134.EL7
Texlive-dvipng.noarch 2:SVN26689.1.14-38.EL7
Texlive-dvipng-bin.x86_64 2:SVN26509.0-38.20130427_R30134.EL7
Texlive-kpathsea.noarch 2:SVN28792.0-38.EL7
Texlive-kpathsea-bin.x86_64 2:SVN27347.0-38.20130427_R30134.EL7
Texlive-kpathsea-lib.x86_64 2:2012-38.20130427_R30134.EL7
Using
[email protected] 18.matplotlib]# python m001.py
Traceback (most recent):
File "m001.py", line 1, <module>
Import Matplotlib as Mpl
Importerror:no module named Matplotlib
Pip
# pip Install Matplotlib
Collecting Matplotlib
Downloading matplotlib-1.5.1.tar.gz (54.0MB)
36% |███████████▉| 20.0MB 177kb/s ETA 0:03:12
Error
Freetype:no [The C + + header for Freetype2 (ft2build.h)
Could not being found. Need to install the
Development package.]
Png:no [pkg-config information for ' libpng ' could not
be found.]
Qhull:yes [pkg-config information for ' qhull ' could ' is
Found. Using local copy.]
# yum Install Freetype-devel
# yum Install Libpng-devel
Reference
Http://www.cnblogs.com/vamei/archive/2013/01/30/2879700.html
Sample code
# a strait Line:use Pyplot functions
From Matplotlib.pyplot Import *
Plot ([0, 1], [0, 1]) # Plot a line from (0, 0) to (1, 1)
Title ("A Strait line")
Xlabel ("x value")
Ylabel ("Y value")
Savefig ("M002.png")
"Python" matplotlib