Input values, this takes either a single array or a sequence of arrays which are not required to be of the same length.
If an integer is given, bins + 1
bin edges are calculated and returned, consistent with numpy.histogram
.
If bins
is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins
is returned unmodified.
All but the last (righthand-most) bin is half-open. In other words, if bins
is:
then the first bin is [1, 2)
(including 1, but excluding 2) and the second [2, 3)
. The last bin, however, is [3, 4]
, which includes 4.
Unequally spaced bins are supported if bins is a sequence.
With Numpy 1.11 or newer, you can alternatively provide a string describing a binning strategy, such as 'auto', 'sturges', 'fd', 'doane', 'scott', 'rice' or 'sqrt', see numpy.histogram
.
The default is taken from rcParams["hist.bins"] = 10
.
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
If True
, the first element of the return tuple will be the counts normalized to form a probability density, i.e., the area (or integral) under the histogram will sum to 1. This is achieved by dividing the count by the number of observations times the bin width and not dividing by the total number of observations. If stacked is also True
, the sum of the histograms is normalized to 1.
Default is None
for both normed and density. If either is set, then that value will be used. If neither are set, then the args will be treated as False
.
If both density and normed are set an error is raised.
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 or density is True
, the weights are normalized, so that the integral of the density over the range remains 1.
Default is None
.
This parameter can be used to draw a histogram of data that has already been binned, e.g. using np.histogram
(by treating each bin as a single point with a weight equal to its count)
counts, bins = np.histogram(data) plt.hist(bins[:-1], bins, weights=counts)
(or you may alternatively use bar()
).
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 or density 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 and/or density is also True
, then the histogram is normalized such that the first bin equals 1.
Default is False
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 to 0.
Default is None
The type of histogram to draw.
Default is 'bar'
Controls how the histogram is plotted.
- 'left': bars are centered on the left bin edges.
- 'mid': bars are centered between the bin edges.
- 'right': bars are centered on the right bin edges.
Default is 'mid'
If 'horizontal', barh
will be used for bar-type histograms and the bottom kwarg will be the left edges.
The relative width of the bars as a fraction of the bin width. If None
, automatically compute the width.
Ignored if histtype is 'step' or 'stepfilled'.
Default is None
If True
, the histogram axis will be set to a log scale. If log is True
and x is a 1D array, empty bins will be filtered out and only the non-empty (n, bins, patches)
will be returned.
Default is False
Color spec or sequence of color specs, one per dataset. Default (None
) uses the standard line color sequence.
Default is None
String, or sequence of strings to match multiple datasets. Bar charts yield multiple patches per dataset, but only the first gets the label, so that the legend command will work as expected.
default is None
If True
, multiple data are stacked on top of each other If False
multiple data are arranged side by side if histtype is 'bar' or on top of each other if histtype is 'step'
Default is False
Deprecated; use the density keyword argument instead.
Patch
properties
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4