Sturges' rule, proposed by Herbert Sturges in 1926, is a practical rule about the number of classes to consider when making a histogram.
This number is given by the following expression: c = 1 + log 2 ( M ) {\displaystyle c=1+\log _{2}(M)} , where M is the sample size.
That can be written from base 10 logarithms in the following way: c = 1 + log ( M ) log ( 2 ) {\displaystyle c=1+{\frac {\log(M)}{\log(2)}}} , where M is the sample size.
The value of c (number of classes) is common to round it to the nearest integer.
wiki