Skip to content

Commit a305177

Browse files
committed
DOC: more updates
1 parent b1afe65 commit a305177

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

galleries/examples/statistics/histogram_normalization.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
which is flexible and helpful, but can also lead to confusion. In particular,
1010
you can:
1111
12-
- bin the data as you want, either with an automatically chosen number of
13-
bins, or with fixed bin edges,
14-
- normalize the histogram so that its integral is one,
15-
- and assign weights to the data points, so that each data point affects the
16-
count in its bin differently.
12+
- bin the data as you want, either with an automatically chosen number of
13+
bins, or with fixed bin edges,
14+
- normalize the histogram so that its integral is one,
15+
- and assign weights to the data points, so that each data point affects the
16+
count in its bin differently.
1717
1818
The Matplotlib ``hist`` method calls `numpy.histogram` and plots the results,
1919
therefore users should consult the numpy documentation for a definitive guide.
@@ -92,10 +92,12 @@
9292
# %%
9393
# This normalization can be a little hard to interpret when just exploring the
9494
# data. The value attached to each bar is divided by the total number of data
95-
# points _and_ the width of the bin, and thus the values _integrate_ to one
95+
# points *and* the width of the bin, and thus the values _integrate_ to one
9696
# when integrating across the full range of data.
97-
# e.g. (``density = counts / (sum(counts) * np.diff(bins))``),
98-
# and (``np.sum(density * np.diff(bins)) == 1``).
97+
# e.g. ::
98+
#
99+
# (``density = counts / (sum(counts) * np.diff(bins))``)
100+
# (``np.sum(density * np.diff(bins)) == 1``).
99101
#
100102
# This normalization is how `probability density functions
101103
# <https://en.wikipedia.org/wiki/Probability_density_function>`_ are defined in

0 commit comments

Comments
 (0)