当前位置:网站首页>matplotlib. pyplot. Hist parameter introduction
matplotlib. pyplot. Hist parameter introduction
2022-06-30 03:43:00 【stone_ tigerLI】
The official introduction :
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist.html
matplotlib.pyplot.hist(x, bins=None, range=None, density=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, color=None, label=None, stacked=False, *, data=None, **kwargs)
Draw histogram .
| Parameters | explain | |
|---|---|---|
| parameters | X | Input data , Array , If it is multi-dimensional , The same length is not required |
| bins | Histogram interval , Integers 、 Sequence or string , The default value is 10, If it's an integer , Then it is divided into the equal interval width of the number of integer values ; If sequence , front n-1 One is left closed and right open section , The last one is a totally closed interval ; If string , The alternatives are :numpy.histogram_bin_edges: 'auto', 'fd', 'doane', 'scott', 'stone', 'rice', 'sturges', or 'sqrt'. | |
| range | tuple perhaps None,bins The upper and lower bounds of , Out of bounds ignore , If it is empty , be range by (x.min(), x.max()), if bins Is a sequence or string , Then the upper and lower bounds and bins Agreement . | |
| density | Boolean type , Default :False. If it is true , Plot the probability density distribution (density = counts / (sum(counts) * np.diff(bins))), The area of the histogram is 1,(np.sum(density * np.diff(bins)) == 1)., if stacked It's true , The sum is normalized to 1. | |
| weights | Array , Default None. And X They have the same shape . if density It's true , be weights normalization , To ensure that the density integral within this range is still 1. | |
| cumulative | Boolean or -1, Default :False. If it is true , Then each bin Is the cumulative count from the first . if density It's true , The histogram is normalized , And the last one bin by 1. If it is less than 0 Number of numbers , Reverse the cumulative direction . | |
| bottom | Array , Scalar or none , Default :None. Interval between histogram and bottom , If it is a scalar , Then the whole body moves upward bottom. If it's an array , be shape And bins matching , Every bin Independent translation . | |
| histtype | {‘bar’, ‘barstacked’, ‘step’, ‘stepfilled’}, Default : ‘bar’. Type of histogram drawn :'bar’ Is a traditional bar histogram ,‘barstacked’ It is a bar histogram with multiple data stacked on top of each other ,'step’ Is an unfilled line graph ,‘stepfill’ It's a filled line diagram | |
| align | Alignment mode ,{‘left’, ‘mid’, ‘right’}, default: ‘mid’ | |
| orientation | Direction ,{‘vertical’, ‘horizontal’}, default: ‘vertical’. Two directions , Default vertical direction , The following boundary is the bottom .‘horizontal’ Is the horizontal histogram with the left as the bottom | |
| rwidth | Floating point or None. Relative width , If histtype yes ‘step’ perhaps ’stepfilled’, It ignores | |
| log | Boolean type , Default False. If it is true , Then the histogram scale is logarithmic scale | |
| color | Color , The default is no | |
| label | str or None, | |
| stacked | Boolean type , If it is true , Then multiple data stacks , If it's false , There are two situations ,histtype by ‘bar’ when , Then arrange the data side by side ,histtype by ‘step’ when , The stack | |
| Returns | n | Value of histogram interval , And weight and probability density . |
| bins | Array , The length is nbins+1 | |
| patches | Do not understand , It doesn't affect the result | |
| The other parameters | ec | Histogram boundary line color |
| alpha | transparency |
边栏推荐
- [wechat applet] how did the conditional rendering list render work?
- [frequently asked questions] modularization of browser environment and node environment
- Vscode+anaconda+jupyter reports an error: kernel did with exit code
- 1151_ Makefile learning_ Static matching pattern rules in makefile
- 【笔记】2022.6.7 数据分析概论
- 【作业】2022.5.28 将CSV写入数据库
- 你清楚AI、数据库与计算机体系
- Number of students from junior college to Senior College (III)
- [0x0] 校长留的开放问题作业
- [punch in - Blue Bridge Cup] day 3 --- slice in reverse order list[: -1]
猜你喜欢

C#【高级篇】 C# 多线程

云原生——Web实时通信技术之Websocket

X Book 6.89 shield unidbg calling method

MySQL performance optimization (5): principle and implementation of master-slave synchronization

Product thinking - is the future of UAV express worth looking forward to?

laravel9本地安装

1151_ Makefile learning_ Static matching pattern rules in makefile

51 single chip microcomputer indoor environment monitoring system, mq-2 smoke sensor and DHT11 temperature and humidity sensor, schematic diagram, C programming and simulation
![[ten minutes] manim installation 2022](/img/54/7b895d785c7866271f06ff49cb20aa.png)
[ten minutes] manim installation 2022

LitJson解析 生成json文件 读取json文件中的字典
随机推荐
【作业】2022.5.23 MySQL入门
[qt] qmap usage details
Usage record of unity input system (instance version)
你清楚AI、数据库与计算机体系
Implementation of property management system with ssm+ wechat applet
【力扣刷题总结】数据库题目按知识点分类总结(持续更新/简单和中等题已完结)
unity input system 使用记录(实例版)
Dripping backward (II)
Magical Union
Global and Chinese market of bronze valves 2022-2028: Research Report on technology, participants, trends, market size and share
I have published a book, "changing life against the sky - the way for programmers to become gods", which is open source. I have been working for ten years. There are 100 life suggestions from technica
2021-07-05
C [advanced part] C generic [need to be further supplemented: generic interfaces and instances of generic events]
Openssl3.0 learning 22 provider decoder
SDS understanding in redis
毕业设计EMS办公管理系统(B/S结构)+J2EE+SQLserver8.0
LitJson解析 生成json文件 读取json文件中的字典
Stc89c52/90c516rd/89c516rd ADC0832 ADC driver code
Tidb 6.0: making Tso more efficient tidb Book rush
Realization of BFS in C language by storing adjacency matrix of graph