# Histogram list returning bin centers and count numbers rather than bin domain points

Is there a native Mathematica function, similar to HistogramList[...] which will return a list of bin centres and associated counts, rather than the bin domains. I guess it is probably a quick thing to write a custum function based on HistogramList[...] but if there is already a native function for this, then that would be great.

• Why not use the second argument of HistogramList and specify exactly which bins you want? – bill s Oct 23 '18 at 21:09
• @bills Because I don't always know that depending on my data type, I specify the number of bins either by some $n^{1/3}$ rule or some of the other histogram bin number algorithm. – Q.P. Oct 23 '18 at 21:13

If I understand the question, instead of:

list = HistogramList[RandomReal[{0, 10}, 100]]
{{0, 2, 4, 6, 8, 10}, {20, 17, 14, 27, 22}}

you want:

{MovingAverage[list[[1]], 2], list[[2]]}
{{1, 3, 5, 7, 9}, {23, 24, 25, 17, 11}}

or maybe you would prefer: