Python使用pylab绘制直方图
来源:互联网 发布:建行网络培训系统注册 编辑:程序博客网 时间:2024/05/22 12:42
Python直方图
#!/usr/bin/python# -*- coding: utf-8 -*-import pylab as pldataFile = "dataList.txt"tempList = []with open(dataFile,"r") as data: for everLine in data: arrEverLine = [float(index) for index in everLine.split()] tempList.append(arrEverLine[0])pl.hist(tempList,100)pl.xlabel("直方图标题")pl.show()
dataList.txt内容
14 2 1 0.5 0.5 0 1 0.5 1.5 18.5
19 2 2 0.5 1 0 1 0.5 0 21
19.5 2 1.5 2 0 0.5 2 0 1 20
17.5 1.5 1 1.5 2 0 1.5 0 0 18.5
19.5 2 2 2 0.5 0 1 0 0.5 19.5
16.5 2 0.5 1 0 0.5 0.5 0 0.5 19.5
15.5 2 1 1.5 0 0 1 0.5 1 17.5
13.5 1.5 1 1 2 0 2 0.5 2 20
14.5 2 1.5 2 0 0 1 0 2 18.5
16 2 2 1.5 1 0.5 1 0 2 19.5
。。。
输出结果
0 0
- Python使用pylab绘制直方图
- 使用python pylab库 画线
- 使用python pylab库 画线
- python pylab.plot() 方法使用
- python pygal绘制直方图
- python 使用matplotlib,pylab进行python绘图
- Python编程-matplotlib3D直方图绘制
- pylab绘制图表
- pylab 画直方图,numpy画直方图。
- numpy直方图和pylab直方图的比较
- 【python图像处理】python绘制灰度直方图
- 【python笔记】使用matplotlib,pylab进行python绘图
- 【python笔记】使用matplotlib,pylab进行python绘图
- Python:使用pycha快速绘制办公常用图(饼图、垂直直方图、水平直方图、散点图等七种图形)
- Python:使用pycha快速绘制办公常用图(饼图、垂直直方图、水平直方图、散点图等七种图形)
- Python:使用pycha快速绘制办公常用图(饼图、垂直直方图、水平直方图、散点图等七种图形)
- Python 使用 pylab 库实现画线功能的方法详解
- python 直方图的绘制方法全解
- Java汉字与16进制数相互转换
- Echarts地图相关功能整合
- billy启动tomcat配置
- js里window.open被ie屏蔽的解决方法
- MySQL详解--锁
- Python使用pylab绘制直方图
- NVIDIA发新旗舰计算卡Tesla M40:GM200核心+12GB显存
- php取出字符串(包括汉字)首字母函数
- onMeasure
- 《高性能MySQL》读书笔记--索引
- 搭建linux 0.11内核编译环境(转)
- 一个比较实用的考试系统
- JavaScript中的apply和call
- javascript.void(0)依旧会跳转页面问题