windows 7 64 bits matplotlib的安装和简单测试
来源:互联网 发布:旺格子软件 编辑:程序博客网 时间:2024/05/22 15:30
环境配置过程中所需要的软件包等
http://pan.baidu.com/s/1nt5jIhr、下列软件包是基于64位的python,matplotlib、numpy、scipy等均为64位版
1、安装Python2.7,安装过程中选择仅供当前用户使用,这样可以避免安装matplotlib.exe时出现Python未注册的错误。配置python环境变量
2、安装wheel、使用pip install wheel
3、安装numpy、使用wheel install numpy-1.9.2-*文件的全路径
4、安装scipy、同上使用wheel install命令
5、安装matplotlib、直接双击exe文件,如果第一步选择的是当前用户而不是所有用户,此步骤就不会报未注册的错误
6、除了上面的软件包,还需要安装上述包运行所需要的基础包,如six、dateutil、pyparsing等
7、安装six,只需要使用pip install six 、同样安装pyparsing也使用相同的命令
8、安装dateutil的时候,pip install python-dateutil
测试,是否安装成功
[code=python]
import numpy as np
import matplotlib.pyplot as plt
N = 5
menMeans = (20, 35, 30, 35, 27)
menStd = (2, 3, 4, 1, 2)
ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars
fig, ax = plt.subplots()
rects1 = ax.bar(ind, menMeans, width, color='r', yerr=menStd)
womenMeans = (25, 32, 34, 20, 25)
womenStd = (3, 5, 2, 3, 3)
rects2 = ax.bar(ind+width, womenMeans, width, color='y', yerr=womenStd)
# add some
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind+width)
ax.set_xticklabels( ('G1', 'G2', 'G3', 'G4', 'G5') )
ax.legend( (rects1[0], rects2[0]), ('Men', 'Women') )
def autolabel(rects):
# attach some text labels
for rect in rects:
height = rect.get_height()
ax.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d'%int(height),
ha='center', va='bottom')
autolabel(rects1)
autolabel(rects2)
plt.show()
[/code]
复制上述python代码,保存为 test.py
在windows cmd环境下cd到test.py文件目录,执行python test.py
显示图形效果如下:
环境搭建成功!
- windows 7 64 bits matplotlib的安装和简单测试
- 最简单的matplotlib安装和使用
- Windows+matplotlib的安装方法
- 安装numpy和matplotlib简单又不易出错的方法
- windows下安装pillow,numpy和matplotlib
- windows下安装numpy,scipy和matplotlib
- windows和linux安装matplotlib教程
- Numpy和Matplotlib的安装
- 关于matplotlib在windows下的安装
- windows下Python matplotlib的安装
- windows下安装matplotlib
- matplotlib windows下安装
- windows安装matplotlib
- Windows下安装matplotlib
- 64 bits Windows 7 使用 regsvr32 的註冊方式
- RabbitMQ安装和简单测试示例(windows版本)
- python2.7中Matplotlib的安装和应用
- Windows下Redis的安装和测试
- 生活工作中的一些领悟
- Centos7安装OpenStack-Kilo
- ORACLE数据库导出指定表、指定列的数据
- mysql免安装启动过程
- IO流1
- windows 7 64 bits matplotlib的安装和简单测试
- 解决 c#连接Oracle 提示system.data.oracleclient 需要 oracle 客户端软件 8.1.7 或更高版本
- spring security4 之 remember-me
- 陈怡暖:一通发言引发血案,金银是否一蹶不振?(午评)
- linzdb的应用
- XML 和 java对象相互转换
- android Notification 的使用
- Web应用程序的目录结构(转自开源中国:恒者)
- 线段树学习