Two Displays, Two Kinds of Variables
A bar chart and a histogram can both use rectangular bars, so it is easy to confuse them. The key difference is not the bars’ color or shape. It is what the horizontal axis represents: a bar chart displays the categories of a categorical variable, while a histogram groups values of a quantitative variable into numerical intervals.
In Choosing Between Bar Chart, Pie Chart, and Histogram, you learned to match a graph to the variable. In Ordering Bars for Clarity, you learned that category order can follow a meaningful sequence or, for unordered categories, a clear convention such as descending frequency. Here we use those ideas to understand why one display has gaps and the other does not.
The gaps in a bar chart mark the separation between categories. They do not represent missing numerical values between bars. In a histogram, the touching bars show consecutive intervals along a quantitative scale. Their shared edges indicate that one interval ends where the next begins.
What the Horizontal Axis Means
On a bar chart, each horizontal-axis position names a category, such as a commute method or a preferred activity. The categories are distinct groups, not stretches of a number line. If the categories have a meaningful order, preserve it; otherwise, arrange them using a clear rule. The order affects how readers scan the categories, but does not change what each category means.
On a histogram, the horizontal axis is a numerical scale divided into intervals, also called bins. For example, a bin might include commute times from 10 minutes up to, but not including, 20 minutes. The next bin might cover 20 minutes up to, but not including, 30 minutes. The intervals must be placed in numerical order because their positions represent increasing values.
A histogram does not give every individual value its own bar. Instead, each bar summarizes the observations falling in one interval. For equal-width bins, a bar’s height represents the frequency or relative frequency in that interval; with unequal-width bins, heights are proportional to frequency density so bar area represents frequency or relative frequency. A bar chart’s height represents the frequency or relative frequency in its category. Always read the axis label to tell which measure is shown.
Why One Display Has Gaps and the Other Does Not
Categories in a bar chart are separate labels. Between “bus” and “bike,” for example, there is no meaningful set of values that belongs to an in-between category. The gaps visually reinforce that the bars refer to distinct groups. Bar-chart bars usually have equal widths; their heights, not their widths, communicate the counts or proportions.
Histogram intervals, by contrast, cover adjacent parts of a quantitative scale. The interval from 10 to less than 20 minutes is next to the interval from 20 to less than 30 minutes. The bars touch to show that the intervals connect on the number line. If a bin has no observations, its bar has height zero; the scale’s sequence of intervals still continues. Do not insert a category-style gap to suggest that the numerical values on either side are unrelated.
A gap in a bar chart is not evidence that no possible response exists between two categories. It is a visual convention for distinct categories. A touching edge in a histogram does not mean the recorded values themselves form an unbroken stream; it means the bins cover consecutive ranges on a numerical scale.
Worked Example: Commute Method or Commute Time?
Worked Example: Commute Method or Commute Time?
A fictional school survey records two variables for students: usual commute method and one-way commute time in minutes. Which display fits each variable, and what should the horizontal axis and bars show?
Commute method is categorical: each student’s response names a method. Suppose 24 students report these methods:
| Commute method | Count |
|---|---|
| Car | 8 |
| Bus | 7 |
| Bike | 5 |
| Walk | 4 |
A bar chart is appropriate for commute method. These categories have no necessary numerical sequence, so one clear choice is descending frequency: car, bus, bike, walk. Draw four separated bars with heights 8, 7, 5, and 4. Check the total: \(8+7+5+4=24\), matching the number of students.
Commute time in minutes is quantitative. For illustration, suppose 12 recorded times are \(6, 8, 9, 12, 14, 17, 18, 21, 24, 26, 32,\) and \(35\). A histogram can group them into intervals from 0 up to 10 minutes, 10 up to 20 minutes, 20 up to 30 minutes, and 30 up to 40 minutes. The counts are 3, 4, 3, and 2:
The bin counts total \(3+4+3+2=12\), so each of the 12 times is included once. Put the intervals in numerical order along the horizontal axis and let their bars touch. The bar for 10 up to 20 minutes is tallest, so that interval contains the most of these recorded commute times. The histogram groups times into ranges; it does not show each student’s exact time as a separate category.
The two graphs may look similar because both use bars, but their horizontal axes have different meanings. A bar chart compares named commute methods; a histogram shows how quantitative commute times are distributed across ranges.
Worked Example: When the Labels Are Numbers
Worked Example: When the Labels Are Numbers
A fictional volleyball club records players’ jersey numbers. The numbers are 4, 7, 12, and 31, with counts 3, 2, 4, and 1, respectively. Should the club display these data with a histogram just because the values are numbers?
No. Jersey numbers identify players; they do not measure an amount. The difference between jersey numbers 4 and 7 does not mean a player has three more units of some measured quantity, and number 12 is not a value “between” 7 and 31 in the statistical sense relevant here. The variable is categorical, with jersey number serving as a label.
A bar chart is appropriate. It could show four separated bars for jersey numbers 4, 7, 12, and 31, with heights 3, 2, 4, and 1. The counts add to \(3+2+4+1=10\), the number of players represented. The categories can be placed in numerical order for easy reference, but that order does not turn the jersey numbers into quantitative measurements.
This example illustrates why you should classify a variable by what its values mean, not by how they look. As in Common Mistakes Classifying Variable Types, numerical codes or identifiers can represent categories. If a recorded number measures an amount, such as time in minutes, it is quantitative; if it names a category, such as a jersey number, it is categorical.
Worked Example: Histogram Bins Must Stay in Numerical Order
Worked Example: Histogram Bins Must Stay in Numerical Order
A fictional student records daily recreational screen time, in hours, for 16 days. The values are \(0.5, 0.8, 1.1, 1.4, 1.8, 2.0, 2.3, 2.7, 3.1, 3.4, 3.8, 4.2, 4.5, 4.9, 5.2,\) and \(5.7\). Make a frequency table for bins of width 2 hours and describe the graph.
Screen time is a quantitative measurement, so a histogram is appropriate. Use the intervals from 0 up to 2 hours, 2 up to 4 hours, and 4 up to 6 hours. Count the values in each range:
| Screen-time interval (hours) | Count | Values included |
|---|---|---|
| 0 up to 2 | 5 | 0.5, 0.8, 1.1, 1.4, 1.8 |
| 2 up to 4 | 6 | 2.0, 2.3, 2.7, 3.1, 3.4, 3.8 |
| 4 up to 6 | 5 | 4.2, 4.5, 4.9, 5.2, 5.7 |
The counts check: \(5+6+5=16\), the total number of recorded days. The histogram has three touching bars in the order 0 up to 2, 2 up to 4, and 4 up to 6. Their heights are 5, 6, and 5 days. In context, the 2-to-less-than-4-hour interval contains the most of these 16 daily screen-time values.
The same data could be grouped using narrower intervals, which would make more bars and show more detail. For example, intervals of width 1 hour would separate the values into more ranges. That choice can change the visual pattern a reader notices, but it does not change the recorded screen times. Whatever bins are chosen, keep the intervals in numerical order, label their boundaries clearly, and make adjacent bars touch.
Common Mistakes and What a Strong Answer Says
- Choosing a graph because the data values look like numbers. First ask what each value represents. Measured amounts such as minutes are quantitative; identifying labels such as jersey numbers are categories.
- Putting gaps between histogram bars. The bins represent consecutive ranges on a numerical scale. Their bars touch. A bin with no observations has height zero, not a category-style gap.
- Making bar-chart bars touch. Bar-chart bars represent distinct categories. Separate them so the display does not suggest that the categories are adjoining numerical ranges.
- Rearranging histogram bars by frequency. Histogram intervals must stay in numerical order, even if a different bin has a greater count. Frequency sorting is an option for some bar charts, not for numerical intervals.
- Confusing bar order with bar meaning. Changing the order of categories in a bar chart does not change the data. In a histogram, changing interval boundaries changes how observations are grouped, so it can change the visible shape.
- Leaving out what bar height represents. Label the vertical axis as count, frequency, or relative frequency as appropriate. State the variable and units so readers know what the categories or intervals describe.
A strong explanation identifies the variable type and connects it to the display. For example: “Commute time is quantitative, so a histogram groups the times into numerical intervals and uses touching bars.” Or: “Commute method is categorical, so a bar chart shows a separated bar for each method.” These explanations justify the graph choice rather than relying only on its appearance.
Check Your Understanding
For each item, choose a bar chart or histogram and explain what the horizontal axis and gaps should represent.
- A community survey records each person’s preferred type of exercise: swimming, walking, cycling, or dance.
- A weather station records the daily rainfall amount in millimeters. Why should a histogram’s intervals be in numerical order?
- A club records members’ locker numbers. The values are numeric labels. Which display is appropriate, and why?
- In a histogram, one interval has no observations. What is its bar height, and should the surrounding intervals be separated by a category-style gap?
- A bar chart displays ordered ratings of poor, fair, good, and excellent. Explain why the categories may remain in that order even if “good” has the greatest count.