What the chart shows
A histogram shows the distribution of a quantity that has been measured many times: heights, times, weights, test scores. The measurements are grouped into classes, intervals that together cover the axis without gaps, and a bar stands over each class. The NIST/SEMATECH e-Handbook of Statistical Methods describes the purpose as summarising the distribution of a data set graphically: where the values lie, how spread out they are, whether the distribution is skewed and whether it has several peaks.
The general rule is that the area of a bar shows how many values lie in its class. When all classes are equally wide, which NIST gives as the most common form, the area is proportional to the height, and then the height shows the count as well. The vertical axis can then be labelled frequency, the count per class.
The data behind the figure
| Class | Count |
|---|---|
| 140–145 | 2 |
| 145–150 | 5 |
| 150–155 | 9 |
| 155–160 | 8 |
| 160–165 | 4 |
| 165–170 | 2 |
The classes are written as intervals. Here 150–155 means from 150 cm up to but not including 155 cm, so a pupil of exactly 155 cm falls in the class 155–160. Where the boundary values go has to be decided, and it should be stated with the chart.
How to read it
- The largest class. The tallest bar, when the classes are equally wide: most pupils, 9, have a height from 150 to 155 cm.
- How many in an interval. Add the bars: 160 cm or taller is 4 + 2 = 6 pupils, that is 20% of the 30.
- The shape. Whether the distribution has one peak in the middle and falls away on both sides, whether it is skewed to one side, and whether a value lies far from the others.
- What the chart does not show. Individual values. A bar says that 9 pupils lie in the class, not where in the class. A mean can only be estimated, using the midpoints of the classes in place of the values: here the estimate is about 154.7 cm.
When it fits and when it does not
A histogram fits when one quantity has been measured many times and its distribution is what should show, and for comparing two distributions grouped into the same classes.
It does not fit when:
- The data are categories. Ways of travelling or favourite fruits have no number line to divide. That is a bar graph.
- There are few values. With eight measurements each bar holds one or two values, and the shape depends more on the classes than on the data. A box plot or the values themselves say more.
- Two quantities have been measured for each person. The relationship is shown in a scatter plot.
Histograms and bar graphs
| Bar graph | Histogram | |
|---|---|---|
| Horizontal axis | categories | a number line, divided into classes |
| Order | free, if the categories have no order | given by the numbers |
| Gaps | between the bars | none: the classes sit edge to edge |
| The count is shown by | the bar’s length | the bar’s area, and its height when the classes are equally wide |
Many descriptions of the histogram, in textbooks too, say that the height shows the count. That holds when the classes are equally wide, which is the most common case. It does not hold when they differ.
Common mistakes
- Gaps between the bars. The classes cover the axis without gaps, and a gap looks like a class with no values in it.
- Classes of different widths with the height equal to the count. The wide class then gets too much area (next section).
- Too few or too many classes. The same data can look different with a different class width. NIST refers to several proposed rules for choosing the number of classes, and it pays to try more than one class width before drawing conclusions about the shape.
- Reading a bar as one value. A bar is a class, with all the values in it.
Going deeper: unequal classes and frequency density
The same 30 pupils can be grouped into classes of different widths, such as 140–150, 150–155, 155–160 and 160–170. The two outer classes are 10 cm wide and hold 7 and 6 pupils; the two inner ones are 5 cm wide and hold 9 and 8.
Drawn with the height equal to the count, 140–150 looks nearly as large as 150–155, although it is twice as wide and the pupils in it are more spread out. The correct height is the frequency density, the count divided by the class width:
| Class | Count | Width | Frequency density |
|---|---|---|---|
| 140–150 | 7 | 10 | 0.7 per cm |
| 150–155 | 9 | 5 | 1.8 per cm |
| 155–160 | 8 | 5 | 1.6 per cm |
| 160–170 | 6 | 10 | 0.6 per cm |
The data behind the figure
| Class | Count | Frequency density |
|---|---|---|
| 140–150 | 7 | 0.7 |
| 150–155 | 9 | 1.8 |
| 155–160 | 8 | 1.6 |
| 160–170 | 6 | 0.6 |
The area of a bar is then width times height, 10 · 0.7 = 7, the number of pupils in the class, and the area of the whole histogram is 30. The GCSE mathematics specification of AQA, an English exam board, includes histograms with equal and unequal class intervals.
If the frequency density is also divided by the number of values, the total area becomes 1. NIST describes this normalisation and that it is the appropriate one when a density function, such as a normal distribution, is drawn over the histogram. The area over an interval is then the share of values in the interval, in the same way as the area under the density function is the probability.