This entry is part of the Chart Index, the reference library for the Chart Design Field Guide.

A histogram looks like a bar chart and is almost never used as one. The bars are contiguous because the x-axis is continuous; the height of each bar is the count of observations that fall into that bin. The chart's purpose is not comparison between categories — it is the visualisation of a distribution: shape, centre, spread, tails, modes.

Everything that follows is a consequence of choosing a bin width. The same data, binned differently, can show a smooth bell, a bimodal split, or a noisy comb. The bin is not a neutral choice; it is the analyst's primary lever, and the most important honesty in histogram design is to make that choice visible.

What it is

A histogram divides a continuous variable into intervals of equal width (bins) and plots the count of observations in each bin as a vertical bar. Bars touch — there are no gaps — because the x-axis is continuous. The y-axis is a count (or, equivalently, a density: count divided by bin width, which makes histograms with different bin widths comparable).

The hero chart above is a year of Melbourne daily maximum temperatures in two-degree bins. The shape carries the message: a peak in the mid-teens where the cool half of the year piles up, a long, gently sloping shoulder through the twenties, and a thin tail out past forty that holds only a handful of days. A mean of about 21 °C would tell you none of that. Randomise the counts and the bars shuffle, but the skew survives, because it is a property of the shape and not of any single bin.

When to use it

Histograms are the right choice when:

  • You have one continuous variable and want to see its distribution.
  • The reader's question is "what is the shape of this?" — is it normal, skewed, multimodal, uniform?
  • You have enough observations to populate the bins meaningfully — usually at least a few hundred, often thousands.
  • You want to see tails and outliers that summary statistics hide.
  • The data is continuous (or near-continuous integers with many possible values).

When not to use it

  • Discrete categories. A histogram requires a continuous x-axis. For count by region, use a bar chart (gaps between bars), not a histogram.
  • Very few observations. Sub-50 observations cannot fill bins reliably. Use a strip plot, dot plot, or jittered scatter to show every point.
  • Comparing many distributions. Two histograms overlaid become hard to read; four are illegible. Use small multiples, ridge plots, or box plots.
  • Time-series data. A histogram of one day's traffic shows distribution shape but loses the sequence. Use a line chart for the time axis.

Design principles

Try several bin widths

The first histogram you draw is almost never the right one. Halve the bin width; double it. The features that persist across bin widths are real; the features that appear in one and vanish in another are artifacts. Few recommends showing the chart with the most useful bin width and noting in the subtitle what was tried.

The three figures below bin the same 400 support-ticket resolution times three ways. Randomise perturbs the counts of each independently — the point is what the bin width does to a fixed set of observations.

Three bins: too coarse
Four-hour bins. The distribution looks like a single lump that decays to the right. The trough between the two modes has been averaged away inside the second bin.
Twelve bins: the structure appears
One-hour bins. Two modes — quick answers around 1–2 hours and escalated tickets around 8 — with a trough between them. This is the bin width that tells the truth about these observations.
Forty-eight bins: too fine
Quarter-hour bins. The two modes are still there, but so is a comb of sampling noise that the reader has to see through. With 400 observations there are simply not enough tickets per bin.

Anchor at zero on the y-axis

The y-axis is a count. Counts begin at zero; truncating distorts the apparent shape. The same rule that governs bar charts governs histograms.

Make bins touch

The absence of gaps between bars is what tells the reader the x-axis is continuous. A histogram with gapped bars (the spreadsheet default) reads as a bar chart and invites the wrong interpretation. Set bar padding to zero, or close to it.

Gapped bars: reads as twelve categories
The same Melbourne temperatures with the spreadsheet default gap. The eye compares bar to bar as if 14–16 and 16–18 were separate things, rather than neighbouring slices of one continuous scale.
Contiguous bars: reads as one distribution
Close the gaps and the bars become a silhouette. The reader sees a shape — peak, slope, tail — rather than a ranking of columns.

Use equal-width bins

The histogram's perceptual contract is that the height encodes the count. Unequal bin widths break that contract unless the y-axis becomes density (count per unit). Equal widths are simpler, harder to mislead with, and almost always what you want.

Annotate the mean, median, or mode when it matters

A vertical rule at the mean (or median) anchors the distribution. A short label — median 21 °C — gives the reader a foothold. Do not assume the eye will estimate the centre correctly; in a skewed distribution the tail pulls the mean away from the peak, and the reader's eye tends to land on the peak.

A quiet rule at the median
Half of Melbourne's days had a maximum below about 21 °C. The rule sits well to the right of the peak because the warm tail is long — exactly the gap between mode and median that a reader would otherwise misjudge.

Show overlapping distributions with care

Two histograms on the same axes need transparency or careful colour separation. Better: use a density plot (a smoothed curve) for overlay, and reserve histograms for single-distribution display.

Two distributions: switch to density curves for the overlay
Sydney and Melbourne daily maxima on one pair of axes. As histograms the two sets of bars would interleave or hide one another; as curves the reader can see that Sydney is warmer and, more usefully, narrower.

Reveal the tails

A long right tail may contain a tiny fraction of the data but the most important observations (p99 latency, fraud detections, billion-dollar customers). Do not crop the x-axis to zoom into the bulk; that hides the tail. If the tail is too long to show, use a log x-axis and explain it.

Keep the tail on the page
API response times in 20 ms bins. Nineteen of every twenty requests finish inside 120 ms, but the last eight bins — thin as they are — are where the p99 lives. Cropping the axis at 160 ms would make this service look faster than it is.

Anatomy

The composition of a histogram
An anatomical guide

The histogram is structurally a bar chart with two crucial differences: bars touch, and the x-axis is continuous and numeric. Every other principle of clean bar-chart design — anchor at zero, quiet the chartjunk, label the axes — applies unchanged.

  • Density plot — a smoothed continuous version of the histogram. Free of bin-width artifacts, but it invents detail between observations.
  • Box plot — summarises the same distribution as five numbers. Compact for comparing many groups, but hides shape.
  • Violin plot — a density plot mirrored around a vertical axis. Shows full shape, often with a box plot inside.
  • Strip / dot plot — every point shown individually. Useful when N is small.
  • CDF — cumulative distribution function. Better than a histogram for tail behaviour and direct percentile reading.

Reading list

  • Tukey, J. (1977). Exploratory Data Analysis. The original case for distribution-first thinking.
  • Scott, D. (1979). On Optimal and Data-Based Histograms. The formal treatment of bin selection.
  • Freedman, D. & Diaconis, P. (1981). On the Histogram as a Density Estimator. The bin-width rule that bears their names.
  • Cleveland, W. (1993). Visualizing Data. On comparing distributions visually.