PythonMatplotlib

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PythonMatplotlib相关的知识,希望对你有一定的参考价值。

////// HomePage

http://matplotlib.org/index.html


////// install

sudo yum install python-matplotlib

已安装:

  python-matplotlib.x86_64 0:1.2.0-15.el7


作为依赖被安装:

  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 call last):

  File "m001.py", line 1, in <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/C++ header for freetype2 (ft2build.h)

                            could not be found.  You may 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 not be

                            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")


以上是关于PythonMatplotlib的主要内容,如果未能解决你的问题,请参考以下文章

非自锁物理按键实现自锁功能控制的方法总结

Arduino 实现点动物理按键触发变为软件上自锁状态保持控制方法

8个IO口检测64个按键,按键自锁控制方式

交流接触器的选型知识

蓝桥杯单片机自锁怎么解决

51单片机 3个IO口 + TM1638+24个独立按键扫描(非自锁按键)+驱动8位共阳数码管显示+Proteus仿真