【Python】Matplotlib
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了【Python】Matplotlib,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1812字,纯文字阅读大概需要3分钟。
内容图文
////// 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
[root@wode005 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")
原文:http://huangchao.blog.51cto.com/10446378/1743579
内容总结
以上是互联网集市为您收集整理的【Python】Matplotlib全部内容,希望文章能够帮你解决【Python】Matplotlib所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。