4  Quantitative data

4.1 Displaying quantitative data

Objective: find ways to visualise the distribution of a quantitative variable.

NoteMotivating example

Let’s look at the graphs in “Does AI stop children from learning?”, The Economist (18 August 2026), about the impact of AI on pupils’ learning.1

Recall: a bar chart displays the distribution of a categorical variable. The horizontal axis of a bar chart just names the categories.

For a quantitative variable, we use a histogram instead. The horizontal axis of a histogram shows the variable values in order. A histogram slices that axis into equal-width bins, and the height of each bar shows the count of observations falling in that bin. Because the axis is ordered, gaps between bars are now meaningful: they show regions with no observations.

A histogram has one parameter: the number of bins (equivalently, the bin width).

  • too few bins: the histogram is imprecise, hiding structure in the data
  • too many bins: the histogram is too specific — it shows gaps and noise that make the overall shape harder to see

For example, here is the distribution of fathers’ height (in inches) from Galton’s family heights dataset (see here for a brief description), shown with 3 bins, 17 bins, and 60 bins:

Three bins hide the shape almost entirely; 60 bins are noisy, with gaps that don’t reflect anything meaningful about fathers’ heights. Seventeen bins are a reasonable trade-off.

Tip

In the course dashboard: load a dataset, switch the plot type to Histogram, and drag the Number of bins control to change its value.

We can also display a distribution with a density plot. A density plot smooths the bins of a histogram, which reduces the effect of the bin-width choice: how much the plot is smoothed (the bandwidth) is still a choice though, albeit slightly easier.

Tip

In the course dashboard: switch the plot type to Density and drag the Bandwidth control to show how smoothing changes the shape.

4.2 The shape of a distribution

We summarise the shape of a distribution in terms of three attributes:

  • how many modes it has
  • whether it is symmetric or skewed
  • whether it has any outliers

4.2.1 Modes

Does the histogram have a single, central hump, or several separated humps? These humps are called modes.2 A histogram with one peak is unimodal; one with two peaks is bimodal; one with three or more peaks is multimodal. A histogram with no clear mode, where all the bars are approximately the same height, is called uniform.

Bimodal example: the Old Faithful geyser. Old Faithful got its name from its regular intervals between eruptions (see here for a brief description of the dataset). If you took a data-driven approach and simply computed the average waiting time between eruptions, you would find it is about 72 minutes — so, knowing when the last eruption happened, you might plan to show up 72 minutes later.

Mean waiting time: 72.3 minutes

But this strategy is a bad one: the histogram of waiting times is clearly bimodal, with a cluster of short waits and a separate cluster of long waits, and hardly any eruptions with a waiting time close to the mean.

Showing up 72 minutes after the last eruption all but guarantees that you either just missed one or still have a long wait ahead.

Uniform example: sugar content of breakfast cereals. The sugars variable (grams of sugar per serving) in the breakfast cereals dataset (see here for a brief description) has no clear mode: with 7 bins, the bars are all roughly the same height.

4.2.2 Symmetry and skew

Is the histogram symmetric? Can you fold it along a vertical line through the middle and have the two sides match closely, or are more of the values on one side?

Symmetric example: parents’ heights. The father column of Galton’s family heights dataset, with 17 bins, is close to symmetric:

For non-symmetric, unimodal distributions, the thinner ends of the distribution are called the tails. If one tail stretches out farther than the other, the histogram is skewed toward the side of the longer tail.

Positively skewed example: Pokémon weight. Most Pokémon are light, but a handful are extremely heavy, stretching the right tail (see here for a brief description of the dataset):

Negatively skewed example: Pixar Rotten Tomatoes scores. Most Pixar films score very highly, but a few score much lower, stretching the left tail (see here for a brief description of the dataset):

4.2.3 Outliers

Do any unusual features stick out? Such features often say something interesting about the data. Always mention any stragglers, or outliers, that stand apart from the body of the distribution.

Outliers affect almost every statistical method, so be on the lookout for them. An outlier can be informative or just an error.

Example: Pokémon height. Most Pokémon are under 2 metres tall, but Wailord stands out at 14.5 metres:

pokemon height
wailord 14.500000
Warning
  • Don’t try to interpret the shape of a bar chart. Category order is arbitrary in a bar chart, so “modes”, “symmetry”, and “skew” are only meaningful for histograms of quantitative variables.
  • A plot should always have labels on the x-axis and y-axis (with units).

4.2.4 Statistics is an old topic

Histograms, and statistical reasoning more generally, are not a recent invention. As early as 1901, Francis Galton used a histogram-like figure in an article arguing for eugenic policies (Galton 1901) (PDF).

Warning

Galton’s statistical technique in this article is, for its time, relatively sound — yet the article’s premise and conclusions rest on racist and ableist ideas about “improving” the human population that are rightly rejected today. Sound methodology doesn’t guarantee sound conclusions: a biased question or unexamined assumption can steer even a competently executed analysis toward unsavoury ends. Always interrogate why a study was done and what it assumes, not only how the numbers were computed.


  1. The Economist, “Does AI stop children from learning?”, 18 August 2026: https://www.economist.com/graphic-detail/2026/08/18/does-ai-stop-children-from-learning?utm_campaign=shared_article↩︎

  2. For a categorical variable, the mode is the single value that appears most often; for a quantitative variable, the mode is a peak of the histogram.↩︎