8000 added hist docstring vis normed and densities · matplotlib/matplotlib@d8ee0e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit d8ee0e4

Browse files
committed
added hist docstring vis normed and densities
svn path=/trunk/matplotlib/; revision=2934
1 parent 89b325c commit d8ee0e4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/matplotlib/axes.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4203,7 +4203,14 @@ def hist(self, x, bins=10, normed=0, bottom=0,
42034203
42044204
If normed is true, the first element of the return tuple w 80ED ill
42054205
be the counts normalized to form a probability density, ie,
4206-
n/(len(x)*dbin)
4206+
n/(len(x)*dbin). In a probability density, the integral of
4207+
the histogram should be one (we assume equally spaced bins);
4208+
you can verify that with
4209+
4210+
# trapezoidal integration of the probability density function
4211+
from matplotlib.mlab import trapz
4212+
pdf, bins, patches = ax.hist(...)
4213+
print trapz(bins, pdf)
42074214
42084215
align = 'edge' | 'center'. Interprets bins either as edge
42094216
or center values

0 commit comments

Comments
 (0)
0