画直方图(hist)
来源:互联网 发布:传奇霸业武器炼体数据 编辑:程序博客网 时间:2024/06/05 20:31
使用hist来创建直方图,也可以使用hist2d来绘制双变量的直方图
#!/usr/bin/python#coding: utf-8# 概率分布直方图# 本例是标准正态分布import numpy as npimport matplotlib.pyplot as plt# 设置均值,中心所在点mean = 0# 用于将每个点都扩大响应的倍数sigma = 1# x中的点分布在 mean 旁边,以mean为中点x = mean + sigma * np.random.randn(20000)# bins 设置分组的个数# normed 是否对y轴数据进行标准化(如果为True,则是在本区间的点在所有的点中所占的概率)# 如果 normed 为False, 则是显示点的数量plt.hist(x, bins = 100, color = "red", normed = True,)# plt.hist(x, bins = 100, color = "red", normed = False,)plt.show()
#!/usr/bin/python#coding: utf-8# 双变量的直方图,可以用来探索双变量的联合分布import numpy as npimport matplotlib.pyplot as pltx = np.random.randn(2000) + 2y = np.random.randn(2000) + 3plt.hist2d(x, y, bins = 40)plt.show()
0 0
- 画直方图(hist)
- hist()直方图
- 【Python-matplotlib】画直方图(hist)
- hist()R 直方图
- hist 绘制直方图函数
- hist 绘制直方图函数
- [R语言绘图]直方图hist
- cv1.6hist直方图操作
- python matplotlib之 hist直方图
- 使用Hist函数实现图像直方图
- matlab hist函数 绘制直方图
- 2017.07.24回顾 plt.hist直方图绘制
- Hist
- MATLAB实现频数直方图——hist的使用
- MATLAB实现频数直方图——hist的使用
- 用plot,hist等函数画各种图示
- 用matplotlib在pdf中画500个hist图
- 画直方图
- Spark基础与Java Api介绍
- IOS9 以后设置状态栏颜色无效解决方法
- 关于音频焦点的理解
- JQeury uploadify參數詳解
- [hihocoder1039]字符消除
- 画直方图(hist)
- C++_rand()函数和srand()函数的用法
- python 3.5 安装和pip安装
- 直播、语音、短视频、VR……体验时代,你如何做营销?
- C/S模式下的打印方法
- springMVC笔记系列(10)——CookieValue注解
- Mac使用rz、sz远程上传下载文件
- 中文写入数据库显示为问号?
- AlarmManager实现定时器、闹钟