What it is
A histogram divides the range of a single numeric measure into equal intervals, called bins, and draws a bar for each whose height is the number of values in that bin. The result is the shape of the data: symmetric or skewed, one peak or two, tight or spread out.
Unlike a bar chart, the x axis is a continuous scale and the bars touch, because the bins cover the range without gaps.
✓ Use it when
- You have one column of many numbers — exam scores, delivery times, heights — and want to see their distribution.
- You want to spot skew, outliers, gaps or several groups mixed together.
✗ Avoid it when
- You have fewer than about twenty values — a dot plot or the sorted numbers are more honest.
- You want to compare several distributions side by side — box plots do that better.
Tips for a better chart
- Try a few bin counts. Too few hides the shape; too many turns it into noise.
- Keep the bars touching and the count axis at zero.
- Say what the bins are in the axis title, such as “minutes”.
The maths
With bin width h starting at x0, a value x falls into bin ⌊(x − x0)/h⌋. Chart Buffet uses Sturges’ rule for the number of bins, k = ⌈log2 n⌉ + 1 (Sturges 1926), then rounds the width to a “nice” number.
Other rules adapt to the data’s spread: Scott’s rule h = 3.49 · s · n−1/3 uses the standard deviation (Scott 1979), and the Freedman–Diaconis rule h = 2 · IQR · n−1/3 uses the interquartile range, which is robust to outliers (Freedman & Diaconis 1981).
A little history
Grouping measurements into intervals and drawing their frequencies is old, but the name is Karl Pearson’s. He introduced “histogram” in his statistics lectures of the early 1890s and first used it in print in an 1895 paper on skewed distributions (Pearson 1895).
Herbert Sturges proposed his simple rule for the number of classes in 1926 (Sturges 1926). Later work treated the histogram as an estimate of a probability density and derived bin widths that minimise its error (Scott 1979; Freedman & Diaconis 1981).
Questions
How many bins should a histogram have?
There is no single right answer. Start with the automatic choice, then try a few more or fewer bins with the “Bins” slider and keep the one that shows the shape most clearly.
Histogram or bar chart?
A histogram is for one continuous measure split into ranges; a bar chart compares separate categories.
References
- Pearson, K. (1895). Contributions to the mathematical theory of evolution. II. Skew variation in homogeneous material. Philosophical Transactions of the Royal Society A 186, 343–414.
- Sturges, H. A. (1926). The choice of a class interval. Journal of the American Statistical Association 21(153), 65–66.
- Freedman, D. & Diaconis, P. (1981). On the histogram as a density estimator: L₂ theory. Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete 57(4), 453–476.
- Scott, D. W. (1979). On optimal and data-based histograms. Biometrika 66(3), 605–610.