Hi group,
I have the following ipython 'session':
In [23]: data = [0, 0.4, 0.6, 1, 2, 3]
In [24]: bins = [0, 1, 2, 3]
In [25]: hist(data, bins, align='edge')
Out[25]: (array([3, 1, 1, 1]), [0, 1, 2, 3], <a list of 4 Patch
)
In [26]: hist(data, bins, align='center')
Out[26]: (array([3, 1, 1, 1]), [0, 1, 2, 3], <a list of 4 Patch
)
I would suspect that the histogram output from 'center' should be [2, 2,
1, 1]. Why is this not so? At least, the two should be different? I
would say that with edge, my bins would be 0-1, 1-2, 2-3, 3-4, and that
center should give me -0.5-0.5, 0.5-1.5, 1.5-2.5, 2.5-3.5, but this
seems not to be the case??? Any help understanding this would be greatly
appreciated!
Thanks,
David