安装matplotlib

 

1.1 Linux中安装matplotlib
  • 如果使用的系统自带的python版本,可使用系统的包管理器安装matplotlib,命令如下:
$ sudo apt-get install python3-matplotlib
  • 如果使用python2.7,命令如下:
$ sudo apt-get install python-matplotlib
  • 如果安装了较新的python版本,就必须安装matplotlib依赖的一些库:
$ sudo apt-get install python3.5-dev python3.5-tk tk-dev
$ sudo apt-get install libfreetype-dev g++
  • 再使用pip来安装matplotlib:
pip install --user matplotlib
1.2 在OS X系统中安装matplotlib
  • Apple的标准python安装自带matplotlib。如果没有,且python是使用homebrew安装的,可使用命令安装matplotlib:
$ pip install --user matplotlib

备注:安装包时可能需要使用pip3。另外,如果这个命令不能用,删除标志--user。

1.3 在windows中安装matplotlib
  • 先安装Visual studio,地址:https://dev.windows.com,下载Visual Studio Community。
  • 下载matplotlib,地址:https://pypi.python.org/pypi/matplotlib/,下载与你使用的python版本匹配的wheel文件(扩展名为.whl的文件)。例如:python3.5,则需要下载matplotlib-1.4.3-cp35-none-win32.whl。
  • 将.whl文件复制到项目文件夹,在该文件夹下打开命令窗口(在文件夹下按住Shift键-右键-打开cmd窗口),使用pip安装matplotlib:
> cd python_work
python_work> python -m pip install --user matplotlib-1.4.3-cp35-none-win32.whl 
1.4 测试matplotlib
$ python3
>>> import matplotlib
>>>

如果没有出现任何错误信息,就说明你安装了matplotlib。

1.5 matplotlib画廊

转载于:https://www.cnblogs.com/DataArt/p/10021910.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值