python matplotlib
背景:
1)数据可视化
目前还处于python入门阶段,主要想通过numpy、matplotlib进行数据可视化。
安装:
操作系统:windows7
1)python2.7 安装numpy、matplotlib
pip安装numpy没有问题
pip通过tar安装matplotlib不成功,提示缺少freetype、png,反正挺麻烦的。
2)python3.5安装numpy、matplotlib
pip直接搞定,安装matplotlib的时候会安装关联的模块。

安装numpy和matplotlib后,pip list展示安装了哪些模块。
使用:
网上随便找了个例子,如下:
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()
运行图:

----------------------------------------------------
python matplotlib的更多相关文章
- python matplotlib 中文显示参数设置
		
python matplotlib 中文显示参数设置 方法一:每次编写代码时进行参数设置 #coding:utf-8import matplotlib.pyplot as pltplt.rcParam ...
 - python matplotlib plot 数据中的中文无法正常显示的解决办法
		
转发自:http://blog.csdn.net/laoyaotask/article/details/22117745?utm_source=tuicool python matplotlib pl ...
 - python matplotlib画图产生的Type 3 fonts字体没有嵌入问题
		
ScholarOne's 对python matplotlib画图产生的Type 3 fonts字体不兼容,更改措施: 在程序中添加如下语句 import matplotlib matplotlib. ...
 - 使用Python matplotlib做动态曲线
		
今天看到“Python实时监控CPU使用率”的教程: https://www.w3cschool.cn/python3/python3-ja3d2z2g.html 自己也学习如何使用Python ma ...
 - python matplotlib 中文显示乱码设置
		
python matplotlib 中文显示乱码设置 原因:是matplotlib库中没有中文字体.1 解决方案:1.进入C:\Anaconda64\Lib\site-packages\matplot ...
 - Python - matplotlib 数据可视化
		
在许多实际问题中,经常要对给出的数据进行可视化,便于观察. 今天专门针对Python中的数据可视化模块--matplotlib这块内容系统的整理,方便查找使用. 本文来自于对<利用python进 ...
 - 转:使用 python Matplotlib 库 绘图 及 相关问题
		
使用 python Matplotlib 库绘图 转:http://blog.csdn.net/daniel_ustc/article/details/9714163 Matplotlib ...
 - python+matplotlib 绘制等高线
		
python+matplotlib 绘制等高线 步骤有七: 有一个m*n维的矩阵(data),其元素的值代表高度 构造两个向量:x(1*n)和y(1*m).这两个向量用来构造网格坐标矩阵(网格坐标矩阵 ...
 - 安装python Matplotlib 库
		
转:使用 python Matplotlib 库 绘图 及 相关问题 使用 python Matplotlib 库绘图 转:http://blog.csdn.net/daniel_ustc ...
 - python matplotlib.pyplot 散点图详解(1)
		
python matplotlib.pyplot散点图详解(1) 一.创建散点图 可以用scatter函数创建散点图 并使用show函数显示散点图 代码如下: import matplotlib.py ...
 
随机推荐
- 2016/10/28 很久没更了 leetcode解题 3sumcloset
			
16.3Sum Closest Given an array S of n integers, find three integers in S such that the sum is closes ...
 - HtmlHelper和强类型转换
			
MVC HtmlHelper;1.Url():<%= Html.ActionLink("用户列表","方法","控制器") %> ...
 - MySQL关键性能监控(QPS/TPS)
			
原文链接:http://www.cnblogs.com/chenty/p/5191777.html 工作中尝尝会遇到各种数据库性能调优,除了查看某条SQL执行时间长短外,还需要对系统的整体处理能力有更 ...
 - load data ERROR 1197 (HY000)错误
			
有一份csv格式的文件,大小在14G左右.max_binlog_cache_size=4G. 登录mysql实例,选择对应的表通过load data往指定表里导数.大概20分钟左右,报以下错误: ER ...
 - 通过java获取html中所有的图片路径
			
/** * 获取网页上所有的图片路径 * @param htmlCode * @return */ public static List<String> getImageSrc(Strin ...
 - 01:Geoserver发布shapfile,中文字段乱码问题
			
软件环境:Geoserver 2.1.0 UDig 1.2.1 shapfile文件结构:FID 地物名称 变化图斑 ...
 - step byt step之餐饮管理系统一
			
之前写过2015年的工作计划,其中有一项就是写一套管理系统,一来可以练练手,二来可以加强自己的学习,三来可以多园友多交流,共同进步.所以从今天开始把写系统的过程记录下来.先需求分析开始. 第一部分 引 ...
 - 用scala实现一个sql执行引擎-(上)
			
前言 在实时计算中,通常是从队列中收集原始数据,这种原始数据在内存中通常是一个java bean,把数据收集过来以后,通常会把数据落地到数据库,供后面的ETL使用.举个一个简单的例子,对一个游戏来说, ...
 - IE6兼容透明JS
			
<!--兼容png格式图片--> <!--[]> <script type="text/javascript" src="Js/DD_bel ...
 - windows7 自带l2tp/ipsec VPN客户端连接Cisco ASA
			
搞了半天,最后发现其实很简单,在ASA默认配置的基础上,把所有crypto ipsec ikev1 transform-set 加上mode transport,然后把tunnel-group Def ...