@@ -6476,22 +6476,22 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6476
6476
range of x.
6477
6477
6478
6478
density : bool, default: False
6479
- If ``True``, the first element of the return tuple will
6480
- be the raw counts per bin normalized to form a probability density
6481
- so that the area under the histogram will integrate to 1, i.e.
6482
- ``np. sum(n * np.diff(bins)) == 1``. (Computed by dividing the
6483
- raw counts ``n0`` by the total number of data points and
6484
- multiplying by the bin width: ``n = n0 / sum(n0) * np.diff(bins)``)
6479
+ If ``True``, draw and return a probability density: each bin
6480
+ will display the bin's raw count divided by the total number of
6481
+ counts *and the bin width*
6482
+ (``density = counts / ( sum(counts) * np.diff(bins))``),
6483
+ so that the area under the histogram integrates to 1
6484
+ (``np. sum(density * np.diff(bins)) == 1 ``).
6485
6485
6486
6486
If *stacked* is also ``True``, the sum of the histograms is
6487
6487
normalized to 1.
6488
6488
6489
6489
weights : (n,) array-like or None, default: None
6490
- An array of weights, of the same shape as *x*. Each value in *x*
6491
- only contributes its associated weight towards the bin count
6492
- (instead of 1). If *normed* or * density* is ``True``,
6493
- the weights are normalized, so that the integral of the density
6494
- over the range remains 1.
6490
+ An array of weights, of the same shape as *x*. Each value in
6491
+ *x* only contributes its associated weight towards the bin count
6492
+ (instead of 1). If *density* is ``True``, the weights are
6493
+ normalized, so that the integral of the density over the range
6494
+ remains 1.
6495
6495
6496
6496
This parameter can be used to draw a histogram of data that has
6497
6497
already been binned, e.g. using `numpy.histogram` (by treating each
@@ -6916,8 +6916,8 @@ def hist2d(self, x, y, bins=10, range=None, density=False, weights=None,
6916
6916
considered outliers and not tallied in the histogram.
6917
6917
6918
6918
density : bool, default: False
6919
- Normalize histogram. *normed* is a deprecated synonym for this
6920
- parameter.
6919
+ Normalize histogram. See the documentation for the *density*
6920
+ parameter of `~.Axes.hist` for more details .
6921
6921
6922
6922
weights : array-like, shape (n, ), optional
6923
6923
An array of values w_i weighing each sample (x_i, y_i).
@@ -6976,7 +6976,7 @@ def hist2d(self, x, y, bins=10, range=None, density=False, weights=None,
6976
6976
"""
6977
6977
6978
6978
h , xedges , yedges = np .histogram2d (x , y , bins = bins , range = range ,
6979
- normed = density , weights = weights )
6979
+ density = density , weights = weights )
6980
6980
6981
6981
if cmin is not None :
6982
6982
h [h < cmin ] = None
0 commit comments