8000 DOC: reword density desc · matplotlib/matplotlib@115348f · GitHub
[go: up one dir, main page]

Skip to content

Commit 115348f

Browse files
committed
DOC: reword density desc
1 parent 2fff6d7 commit 115348f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6364,12 +6364,14 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
63646364
63656365
density : bool, optional
63666366
If ``True``, the first element of the return tuple will
6367-
be the counts normalized to form a probability density, i.e.,
6368-
the area (or integral) under the histogram will sum to 1.
6369-
This is achieved by dividing the count by the number of
6370-
observations times the bin width and not dividing by the total
6371-
number of observations. If *stacked* is also ``True``, the sum of
6372-
the histograms is normalized to 1.
6367+
be the raw counts per bin normalized to form a probability density
6368+
so that the area under the histogram will integrate to 1, i.e.
6369+
``np.sum(n * np.diff(bins)) == 1``. (Computed by dividing the
6370+
raw counts ``n0`` by the total number of data points and
6371+
multiplying by the bin width: ``n = n0 / sum(n0) * np.diff(bins)``)
6372+
6373+
If *stacked* is also ``True``, the sum of the histograms is
6374+
normalized to 1.
63736375
63746376
Default is ``False``.
63756377

0 commit comments

Comments
 (0)
0