Dear colleagues, please help me understand this:
In[1]:= data = RandomVariate[NormalDistribution[0, 1], 200]; HistogramList[data, 3] Out[2]= {{-4, -2, 0, 2, 4}, {5, 84, 109, 2}}
Why there are four and not three bins?
Thank you!
Hi,
see this discussion: http://mathematica.stackexchange.com/questions/7724/problems-specifying-number-of-bins-in-histogram
Conclusion: you need to use the undocumented option "Raw".
HistogramList[data, {"Raw", 3}]
this gives the exact number of bins you want. Note that this comes with the usual health warning: it is an undocumented option and you use it at your own risk. The behaviour you see in the standard HistogramList command is apparently actually intended. Also note that the same thing works for the Histogram command.
gives
Cheers,
M.