Bar graph

By Jude Wallis · Published

A bar graph displays a categorical variable using separated bars whose heights show the count or relative frequency of each category.

A bar graph draws one bar per category of a categorical variable, with the bar's height equal to the frequency in that category or to its relative frequency. Gaps separate the bars because the horizontal axis is a list of labels, not a number line. The categories have to be mutually exclusive, so every observation is counted in exactly one bar and the heights add to nn.

Forty-two students pick a lunch: pizza 18, salad 12, pasta 9, soup 3. The pizza bar is tallest, and its relative frequency is 18/42=0.428618 / 42 = 0.4286, about 43 percent. The four counts add back to 42, which is the check that the categories covered everyone once.

The misreading worth naming is "the bars fall from left to right, so the graph shows a downward trend." Nothing about that horizontal axis is ordered, so there is no trend to read. List the same four categories alphabetically, pasta, pizza, salad, soup, and the bars run 9, 18, 12, 3, rising and then falling. Both pictures are correct and neither says anything about direction.

What the display quietly gets wrong is the baseline. Value is encoded as bar length, so cutting the vertical axis destroys the encoding. On an axis starting at 0, the soup bar is 3/18=0.1673 / 18 = 0.167 of the pizza bar. Start the axis at 2 and the drawn lengths become 16, 10, 7 and 1, so the same soup bar now reads as 1/16=0.06251 / 16 = 0.0625 of the pizza bar, well under half the ratio the counts support. Nothing in the picture warns you. Only the axis labels do.

Order does matter when the variable is ordinal, such as small, medium, large, and there you keep the natural sequence rather than sorting by height. Bar charts sit in topic 1.4, Graphical Representations for One Categorical Variable.

Where this comes up

More graphs and displays terms, or browse the full statistics glossary.