Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e00fe2e

Browse files
committed
DOC: normalizing histograms
1 parent 042d366 commit e00fe2e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

galleries/examples/statistics/histogram_normalization.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,11 @@
159159
ax['True'].legend(fontsize='small')
160160

161161
# %%
162+
162163
# Sometimes people want to normalize so that the sum of counts is one. This is
163-
# _not_ done with the *density* kwarg, but instead we can set the *weights* to
164-
# 1/N. Note, however, that the amplitude of the histogram still depends on
165-
# width of the bins
164+
# not done with the *density* kwarg, but rather we can get this effects if we
165+
# set the *weights* to 1/N. Note, however, that the amplitude of the histogram
166+
# still depends on width of the bins:
166167

167168
fig, ax = plt.subplots(layout='constrained', figsize=(3.5, 3))
168169

@@ -176,7 +177,8 @@
176177

177178
# %%
178179
# The true value of normalizing is if you do want to compare two distributions
179-
# that have different sized populations:
180+
# that have different sized populations. Here we compare the distribution of
181+
# ``xdata`` with a population of 1000, and ``xdata2`` with 100 members.
180182

181183
xdata2 = rng.normal(size=100)
182184

0 commit comments

Comments
 (0)