matplotlib里面的绘制直方图,让我搞晕了好久,Plot a histogram.画一个直方图
Compute and draw the histogram of x. The return value is a tuple (n, bins, patches) or ([n0, n1, ...], bins, [patches0, patches1,...]) if the input contains multiple data. See the documentation of the weights parameter to draw a histogram of already-binned data.
计算并绘制x的直方图,返回值是一个元组(n、bins、patch)或([[n0, n1, ...], bins, [patch0, patches1, ...]),如果输入包含多个数据,则返回值为([n0, n1, ...], bins, [patch0, patches1, ...])。请参考权重参数的文档,绘制一个已经分型的数据的直方图。
元组(tuple)一连串有顺序的数字。
Multiple data can be provided via x as a list of datasets of potentially different length ([x0, x1, ...]), or as a 2-D ndarray in which each column is a dataset. Note that the ndarray form is transposed relative to the list form.
多个数据可以通过x作为一个潜在不同长度的数据集的列表([[x0, x1, ...]),或者作为一个二维ndarray形式提供,其中每个列都是一个数据集。注意,ndarray形式是相对于列表形式而言的。
binsint or sequence or str, optional 有多少个柱状,比如打分精确到0.1 5除以0.1就是50个bins
rangetuple or None, optional
The lower and upper range of the bins. Lower and upper outliers are ignored. If not provided, range is (x.min(),x.max()). Range has no effect if bins is a sequence.
range 是用来规定bins的范围的