Histograms

Category: Statistics   Level: 301

bar height = how many values land in each bin

Group raw numbers into equal bins, count each bin, and draw touching bars. The outline of the bars shows the shape of the data.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Start with the raw data

Here are 24 quiz scores in the order they came in. As a pile of numbers they say very little.

n = 24 scores

Step 1: Start with the raw data

Step 2: Choose equal bins

Split the range into bins of width 10: the 50s, 60s, 70s, 80s, and 90s. Color each score by its bin.

bin width = 10

Step 2: Choose equal bins

Step 3: Tally each bin

Go through the scores once and make a mark in the matching bin. Every fifth mark crosses the four before it, which keeps counting easy.

counts: 2, 4, 7, 8, 3 (total 24)

Step 3: Tally each bin

Step 4: Draw the bars

Each bar covers its bin and rises to its count. The bars touch because the bins have no gaps between them.

bar height = count

Step 4: Draw the bars

Step 5: Read the shape

One peak sits in the 80s. The bars trail off more slowly to the left, so the data is skewed left: a few low scores, most students doing well.

peak in 80–89, tail to the left

Step 5: Read the shape

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render histogram --out /tmp/histogram

Source: svgmath/diagrams/statistics.py