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.
Here are 24 quiz scores in the order they came in. As a pile of numbers they say very little.
n = 24 scores
Split the range into bins of width 10: the 50s, 60s, 70s, 80s, and 90s. Color each score by its bin.
bin width = 10
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)
Each bar covers its bin and rises to its count. The bars touch because the bins have no gaps between them.
bar height = count
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
cd svg-generator python3 -m svgmath render histogram --out /tmp/histogram
Source: svgmath/diagrams/statistics.py