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).

Response time distribution — service A24h sample · 18,420 requests · 10 ms bins

The shape carries the message: roughly normal, with a long right tail. The peak (around 30–40ms) is the mode; the asymmetry hints at the long-tail latencies that p99 reporting tries to capture but a mean would average away.

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.

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.

Bin width changes the story
6 BINS — TOO FEW20 BINS — BIMODAL60 BINS — NOISE
The same 5,000 observations binned three ways. Too few bins hides the bimodality; too many bins makes it look like noise.

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: 38 ms — gives the reader a foothold. Do not assume the eye will estimate the centre correctly; the long tail in a skewed distribution pulls the perceived centre toward the bulk, not the mean.

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.

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.

Anatomy

The Composition of a Histogram
MEAN · 38 ms4000200000306090120RESPONSE TIME (MS)bars touchlong right tail
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.