# Is there a general/golden rule for appropriate binning in a histogram?

I was wondering, is there a general rule or a "golden rule" that sets the appropriate bin size as a function of statistical parameters such as sample size, mean, median, mode, standard deviation, etc. when the data is not known to follow a certain distribution?

The reason why I ask is because I have a relatively large data set (about 1.5 million values). However, the range of these values is from 0 to about 0.6. Nothing is known about the distribution of this data (i.e, is it "normal") because the data itself is derived from an experimental process of which its mechanism is not categorized fully as of yet. I am worried that certain bin sizes will encompass values that would distort the shape of my histogram. I understand that eventually you have to create a hardline boundary for your bins as too fine of a bin control can give you a very awkward shape, a shape that may explain too much diversity even though there might not be. However, if the lines are too ambiguous, you could have a very general shape and you could lose information on data stratification.

Here are some statistical parameters for my data set:

Range = ~0.6

Min = 0

Max = ~0.6

St. Dev = 0.063

n = $1.5*10^6$

• Wikipedia list some different approaches but with over a million data points you could just choose bin widths of $0.01$ starting at $0$, so about $60$ bins and see if that causes an issue with the histogram – Henry Jul 15 '15 at 19:42
• One universal rule should be to draw any histogram in more than one way. See stats.stackexchange.com/a/51753. – whuber Jul 15 '15 at 20:31
• There's a plethora of rules ... and to my eye they tend to oversmooth, some vastly so. What properties did you want this "golden rule" to have? – Glen_b -Reinstate Monica Jul 16 '15 at 1:22
• I want it to be able to not jam meaningful data (kind of ambiguous, I know) into other bins while still giving me enough stratification that I can see differences. – Alvin Nunez Jul 16 '15 at 20:05

it is called, Sturges' rule and is to set the number of intervals as close as possible to $1 + \log_2(N)$