Start With the Variable, Not the Graph
A graph should make the data’s structure easy to see. The first question is not “Which graph looks best?” but “What kind of variable am I displaying?” As in Matching Variable Type to the Right Graph or Summary, categorical data call for displays of categories, while quantitative data call for displays that show numerical values and their distribution.
This distinction guides the choice among a bar chart, a pie chart, and a histogram. Bar charts and pie charts display categorical data. Histograms display quantitative data grouped into numerical intervals. Their bars may look similar at first, but they represent different things.
A survey of favorite school subjects provides a useful example. “Favorite subject” is categorical: each student names a subject, not a numerical amount. A bar chart or pie chart can display the responses. A histogram cannot, because subject names are not numerical intervals. By contrast, the number of minutes a student spends studying is quantitative and can be displayed with a histogram.
What Each Display Makes Easy to See
A bar chart shows the count or proportion for each category. The bars are separated because the categories are distinct groups, not neighboring values on a numerical scale. Category order is usually a choice, except when categories have a meaningful order; as discussed in Ordinal Categories and Rating Scales, ordered categories should retain that order. Bar charts make it straightforward to compare category sizes.
A pie chart represents the same kind of data in a different way: each slice shows that category’s share of the entire group. All slices together make the whole circle. Pie charts are most useful when there is one categorical variable, the categories account for the whole group, and there are few enough slices to distinguish. Comparing slices—especially similar-sized ones—can be harder than comparing bar heights.
A histogram displays quantitative values grouped into intervals, also called bins. For example, travel times might be grouped as 0 to less than 5 minutes, 5 to less than 10 minutes, and so on. The bars touch because the intervals follow one another along a number line; there are no category gaps between one interval and the next. The horizontal axis is numerical, and the bar heights show how many observations fall in the intervals when the bins have equal widths.
The graph should also suit the question. A bar chart is often clearest when the goal is to compare category counts or proportions. A pie chart can quickly show how a small set of categories divides a whole. A histogram helps reveal the shape and spread of quantitative data. None of these displays is automatically best for every situation.
Worked Example: Favorite Subjects Among 163 Students
Worked Example: Favorite Subjects Among 163 Students
Suppose a fictional school survey asks 163 students to name one favorite subject. The responses are summarized below. Choose an appropriate display and describe what the numbers mean.
| Favorite subject | Number of students |
|---|---|
| Mathematics | 46 |
| English | 38 |
| Science | 32 |
| History | 21 |
| Arts | 16 |
| Other | 10 |
| Total | 163 |
First check the total: \(46+38+32+21+16+10=163\). The variable is favorite subject, and its values are categories. A bar chart is appropriate because it makes category counts easy to compare. A pie chart is also possible because each student gave one response and the categories together account for all 163 students. A histogram is not appropriate: subject names are not numerical measurements that can be grouped into intervals.
Relative frequencies can show the share of students in each category. For example, the proportion whose favorite subject is mathematics is:
So about 28.2% of the surveyed students chose mathematics. Applying the same calculation to each count gives the following rounded percentages:
The rounded percentages add to 99.9%, rather than exactly 100%, because each has been rounded. A bar chart could show either the counts or these percentages. A pie chart would use the proportions to determine slice sizes. For example, the mathematics slice would take about \(0.2822\) of the circle, or \(0.2822\times360^\circ\approx101.6^\circ\).
Both categorical displays represent the same distribution, but their visual strengths differ. The bar chart makes it easy to see that mathematics has the largest count and “Other” the smallest. The pie chart emphasizes that each subject’s share is part of the 163 responses. With six categories, either can work; if the goal is to compare category sizes precisely, the bar chart is generally easier to read.
Worked Example: Choosing a Histogram for Travel Times
Worked Example: Choosing a Histogram for Travel Times
A fictional after-school program records the number of minutes each of 40 students takes to travel from school to the program. The staff summarize the times in equal-width intervals:
| Travel time in minutes | Number of students |
|---|---|
| 0 to less than 5 | 3 |
| 5 to less than 10 | 8 |
| 10 to less than 15 | 13 |
| 15 to less than 20 | 10 |
| 20 to less than 25 | 6 |
| Total | 40 |
The variable is travel time, measured in minutes, so it is quantitative. The interval counts check: \(3+8+13+10+6=40\). A histogram is suitable because the intervals are numerical and consecutive. Its bars touch to show that the intervals meet on the number line. A pie chart would turn the time intervals into slices and make the shape of the travel-time distribution harder to assess.
The 10-to-less-than-15-minute interval has the greatest count: 13 of the 40 students. As a proportion, this is:
Thus, 32.5% of the students took at least 10 minutes but less than 15 minutes to travel. A bar chart could display the interval counts as if they were categories, but it would hide the fact that the intervals are adjacent numerical ranges. The histogram’s touching bars communicate that quantitative structure.
Worked Example: Same Survey, Different Variables
Worked Example: Same Survey, Different Variables
A fictional survey of 120 library visitors records each visitor’s preferred way to receive a reminder and the number of minutes the visitor spent looking for a book. Which display should be used for each variable?
| Preferred reminder method | Number of visitors |
|---|---|
| 52 | |
| Text message | 39 |
| Phone call | 18 |
| Other | 11 |
| Total | 120 |
Preferred reminder method is categorical. A bar chart can compare the four response counts. A pie chart could show their proportions of all 120 visitors, since the response categories account for the group. For instance, the proportion preferring email is:
The other variable, minutes spent looking for a book, is quantitative. A histogram is appropriate if the goal is to show how those times are distributed across numerical intervals. It would not be appropriate to put the visitor’s reminder method into a histogram: “email” and “phone call” are categories, not values on a number line.
The survey has two variables for the same visitors, but the graph choice is made separately for each variable. A single display should not mix categorical methods and quantitative time intervals as if they were the same kind of value.
Common Mistakes and AP Exam Tips
- Choosing by appearance alone. Bar charts and histograms both use rectangles, but their horizontal axes mean different things. Identify the variable and its values before deciding.
- Using a histogram for categories. Favorite subjects, device types, and response choices are categories. Use a bar chart or, when appropriate, a pie chart.
- Leaving gaps between histogram bars. Histogram bars represent consecutive numerical intervals. Separate bars would suggest gaps between categories rather than neighboring ranges.
- Making a pie chart for values that do not form parts of one whole. Pie slices should represent categories that divide the group being described. State what group the whole circle represents.
- Assuming one display answers every question equally well. A pie chart highlights shares of a whole; a bar chart often makes category comparisons easier; a histogram displays the distribution of quantitative values.
- Forgetting to check the total. For a one-response-per-person survey, category counts should add to the number of responses. If they do not, check the counts or whether responses could be missing or multiple.
For a full-credit response, name the variable, classify it as categorical or quantitative, choose a graph that matches that type, and explain how the graph represents the data. In context, a complete answer might say: “Favorite subject is categorical, so a bar chart can compare the numbers of students in each subject category. A histogram is unsuitable because subject names are not numerical intervals.”
Check Your Understanding
For each situation, identify the variable type and choose a suitable graph. Give a brief reason for your choice.
- A survey asks 85 students to name their preferred school lunch. Would a bar chart, pie chart, or histogram be appropriate? Explain whether more than one choice could work.
- A coach records the number of seconds each runner takes to complete a short drill. Which of the three displays is most suitable for showing the distribution of times, and why do its bars touch?
- A table lists the counts of students choosing science, arts, mathematics, and history as their favorite subject. Why would a histogram be a poor choice?
- A community survey records the preferred way to receive local alerts: email, text, or phone call. What information would a pie chart emphasize? What display may make comparing the category counts easier?
- A class records the number of minutes students spend reading each evening, grouped into consecutive five-minute intervals. Should the graph use separated or touching bars? Explain what the intervals represent.