hist()——直方图
n, bins, patches = hist (x, bins=10, range=None, normed=False, weights=None, cumulative=False, bottom=None, histtype=’bar’, align=’mid’, orientation=’vertical’, rwidth=None, log=False, color=None, label=None, stacked=False, hold=None, data=None, **kwargs)
参数的意义:
x : (n,) array or sequence of (n,) arrays,表示:就是输入的数据啦,可以为一个序列数,也可以多组;
bins : integer or array_like, 表示:控制分的块数,要分的块数为bins,默认为10;
range : tuple 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.
If bins is a sequence or range is specified, autoscaling is based on the specified bin range instead of the range of x.
Default is None
- normed : boolean, optional, 意义就是说,返回的第一个n(后面解释它的意义)吧,把它们正则化它,让bins的值 的和为1,这样差不多相当于概率分布似的了;
If True, the first element of the return tuple will be the counts normalized to form a probability density, i.e., n/(len(x)`dbin), i.e., the integral of the histogram will sum to 1. If stacked is also True, the sum of the histograms is normalized to 1.
Default is False
- weights : (n, ) array_like or None, optional 啥意义啊,不知道 哦
An array of weights, of the same shape as x. Each value in x only contributes its associated weight towards the bin count (instead of 1). If normed is True, the weights are normalized, so that the integral of the density over the range remains 1.
Default is None
- cumulative : boolean, optional ,就是每一列都把之前的加起来,可能这么说不严谨哦,不过就是那个意思;
If True, then a histogram is computed where each bin gives the counts in that bin plus all bins for smaller values. The last bin gives the total number of datapoints. If normed is also True then the histogram is normalized such that the last bin equals 1. If cumulative evaluates to less than 0 (e.g., -1), the direction of accumulation is reversed. In this case, if normed is also True, then the histogram is normalized such that the first bin equals 1.
Default is Fal
- bottom : array_like, scalar, or None,下面的每个bin的基线,表示bin的值都从这个基线上往上加;
Location of the bottom baseline of each bin. If a scalar, the base line for each bin is shifted by the same amount. If an array, each bin is shifted independently and the length of bottom must match the number of bins. If None, defaults t
Default is None<