Tutorials › AP Statistics › Constructing a Frequency Histogram

Graphs for quantitative data · Tutorial 66 of 1000

Constructing a Frequency Histogram

Practice choosing a bin width for a data set, sorting observations into intervals, checking the counts, and drawing a frequency histogram.

Beginner 9 min read

What You'll Learn

  • Identify the quantitative variable, its units, and the smallest and largest observations before setting up bins.
  • Use one consistent boundary rule so every observation belongs to exactly one interval.
  • Count observations in each bin and verify that the frequencies add to the sample size.
  • Draw touching bars whose heights show bin frequencies on a labeled scale.
  • Check that the histogram’s intervals cover the data without overlaps or omissions.

From Individual Values to Intervals

In Back-to-Back Stemplots for Two Groups, you used a shared scale to compare two quantitative distributions while keeping individual values visible. A frequency histogram also displays quantitative data, but it groups values into intervals and shows how many observations fall in each interval. It gives a compact view of the distribution rather than showing every data value.

Before drawing, identify the variable and its units, find the range of observed values, and set up consecutive intervals. Each interval is called a bin (or class interval). Choose a bin width that suits the values and the detail you want to show. In this tutorial, the examples use simple widths such as 5 or 10 units; choosing among different widths in more detail is the topic of the next tutorial.

Definition: A frequency histogram displays the distribution of a quantitative variable by grouping its values into intervals. The height of each bar represents the frequency, or count, of observations in that interval. The bars touch because the intervals are consecutive numerical ranges, not separate categories.

A frequency histogram has a horizontal axis labeled with the quantitative variable and units, and a vertical axis labeled with frequency or count. The horizontal scale marks the bin boundaries. The vertical scale begins at zero and uses evenly spaced values that cover the largest frequency. Each bar spans one interval, and its height reaches the frequency for that interval.

The boundary rule matters. A useful convention is to include a bin’s lower boundary and exclude its upper boundary: \([10,15)\) includes values \(x\) such that \(10 \le x < 15\). Then a value exactly equal to 15 goes into the next interval, \([15,20)\), not both intervals. If the largest observation is exactly at the final right boundary, include it in the final bin. State or label the convention clearly enough that a reader can tell where boundary values go.

Boundary rule: Make bins consecutive and nonoverlapping. For example, use \([10,15)\), \([15,20)\), and \([20,25]\), where the last bin includes its right endpoint if needed. Every observation must belong to one bin and only one bin.

A Routine for Constructing a Histogram

Keep a tally as you work through the data rather than trying to estimate the bar heights by eye. First set the bin boundaries to cover every observation. Next, assign each value using the same boundary rule, count the values in each bin, and check the total. Then draw one bar per interval, with adjacent bars touching. As in Choosing Between Bar Chart, Pie Chart, and Histogram, the variable’s meaning determines the graph: a histogram is for quantitative values, not categorical labels.

1
Identify the scale and coverage.
Name the quantitative variable and units. Find the minimum and maximum so the bins cover the full data range.
2
Set consecutive bins.
Choose a bin width and write all boundaries in order. Use a consistent rule for values exactly on a boundary.
3
Tally and verify.
Count every observation in exactly one interval. Add the bin frequencies and check that the sum equals the number of observations.
4
Draw and label.
Place bin boundaries on the horizontal axis and frequency on the vertical axis. Draw touching bars to the counted heights, then label the graph with its variable and units.

Equal-width bins make the bar heights easy to compare as counts. Keep the intervals and widths consistent across the graph; do not leave gaps between bars or leave an interval out of the numerical scale. A bar’s height indicates a frequency, not the value of the observations inside it. For instance, a bar over \([20,25)\) with height 4 means four observations are from 20 up to, but not including, 25.

Worked Example: Histogram of Commute Times

Worked Example: Histogram of Commute Times

These invented data are the one-way commute times, in minutes, for 18 people: 12, 14, 15, 17, 19, 20, 20, 22, 24, 25, 25, 27, 28, 30, 31, 33, 34, and 35. Construct a frequency histogram using bins of width 5 minutes.

Set the bins and boundary convention. The observed times range from 12 to 35 minutes. Use \([10,15)\), \([15,20)\), \([20,25)\), and \([25,30)\), followed by a final bin from 30 through 35 minutes, including 35. These bins cover all the observations. Values exactly at 15, 20, 25, or 30 go into the interval that begins at that value.

Count the observations. The first bin contains 12 and 14, so its frequency is 2. The second contains 15, 17, and 19, giving 3. The third contains 20, 20, 22, and 24, giving 4. The fourth contains 25, 25, 27, and 28, also giving 4. The last bin contains 30, 31, 33, 34, and 35, giving 5. The frequency total is \(2+3+4+4+5=18\), which matches the 18 commute times.

Commute time (minutes)Frequency
10 to less than 152
15 to less than 203
20 to less than 254
25 to less than 304
30 through 35, including 355
Total18

Draw the bars. Label the horizontal axis “Commute time (minutes)” and mark 10, 15, 20, 25, 30, and 35. Label the vertical axis “Frequency” and use a scale from 0 through at least 5. Draw five bars with heights 2, 3, 4, 4, and 5 over the intervals in the table. The bars touch because the intervals are consecutive.

The following table is a compact schematic of those heights: each filled square represents one frequency unit. In a hand-drawn graph, use adjacent bars over the numerical intervals rather than treating the bins as separate categories.

Frequency level10–<1515–<2020–<2525–<3030–35
5■
4■■■
3■■■■
2■■■■■
1■■■■■

Check the display. All 18 observations have been counted once, the tallest bar has height 5, and the final bin includes the maximum value of 35 minutes. The histogram shows that the largest count is in the 30-through-35-minute interval. It summarizes these 18 observed commute times; it does not show the individual times within each interval.

Worked Example: Assign Values on Bin Boundaries

Worked Example: Assign Values on Bin Boundaries

A fictional shipping station records package weights, in kilograms: 1.1, 1.4, 1.9, 2.0, 2.0, 2.3, 2.8, 3.0, 3.1, 3.7, 4.0, 4.2, 4.8, and 5.0. Use one-kilogram bins, starting at 1 kilogram, and construct the frequency table needed for a histogram.

Write the intervals first. Use \([1,2)\), \([2,3)\), \([3,4)\), and a final interval \([4,5]\) that includes the right endpoint. Thus, 2.0 belongs in \([2,3)\), 3.0 belongs in \([3,4)\), and 5.0 is counted in the final bin. Values at these boundaries cannot be counted in the bin below and the bin above.

Tally each bin. The values 1.1, 1.4, and 1.9 give frequency 3 in \([1,2)\). The values 2.0, 2.0, 2.3, and 2.8 give frequency 4 in \([2,3)\). The values 3.0, 3.1, and 3.7 give frequency 3 in \([3,4)\). The values 4.0, 4.2, 4.8, and 5.0 give frequency 4 in \([4,5]\).

Package weight (kilograms)Frequency
1 to less than 23
2 to less than 34
3 to less than 43
4 through 5, including 54
Total14

Finish the histogram. Label the horizontal axis “Package weight (kilograms)” with boundaries 1, 2, 3, 4, and 5. Label the vertical axis “Frequency” and use a scale reaching at least 4. Draw four touching bars with heights 3, 4, 3, and 4. The total \(3+4+3+4=14\) confirms that all 14 recorded weights have been assigned exactly once.

Worked Example: Build Wider Bins for Quiz Scores

Worked Example: Build Wider Bins for Quiz Scores

A fictional group of students earned these quiz scores, in points: 41, 44, 46, 49, 50, 52, 56, 59, 60, 61, 63, 67, 69, and 70. Construct a histogram using bins of width 10 points.

Cover the observed scores. The minimum is 41 and maximum is 70, so use \([40,50)\), \([50,60)\), and a final bin \([60,70]\) that includes 70. The bin width is 10 points in each case. Under this rule, a score of 50 is counted in the second bin, and a score of 60 is counted in the third.

Count and check. The scores 41, 44, 46, and 49 fall in \([40,50)\), so the frequency is 4. The scores 50, 52, 56, and 59 fall in \([50,60)\), also giving 4. The scores 60, 61, 63, 67, 69, and 70 fall in the final bin, giving 6. The total is \(4+4+6=14\), equal to the number of scores listed.

Quiz score (points)Frequency
40 to less than 504
50 to less than 604
60 through 70, including 706
Total14

Draw and describe. Mark 40, 50, 60, and 70 on the horizontal axis labeled “Quiz score (points).” Mark frequency from 0 through at least 6 on the vertical axis. Draw touching bars of heights 4, 4, and 6. The two lower score intervals have equal frequencies, while the 60-through-70 interval has the greatest frequency. The graph describes the scores in this group, not all students’ possible quiz scores.

Common Mistakes and Full-Credit Communication

  • Leaving gaps between bars. Histograms display consecutive numerical intervals, so the bars touch. Gaps are used for separated categories in a bar chart, not for neighboring bins in a histogram.
  • Counting a boundary value twice or not at all. Decide which bin receives an exact boundary value and apply that rule throughout. With intervals \([10,15)\) and \([15,20)\), the value 15 belongs to the second interval.
  • Forgetting the maximum at the last boundary. If the maximum equals the right endpoint of the final interval, include it there or extend the bin coverage. Do not silently omit that observation.
  • Using bar heights that do not match the counts. Make a frequency table or tally first, then use those frequencies as heights. Check that their sum equals the number of observations.
  • Leaving the axes unclear. A complete histogram names the quantitative variable and units on the horizontal axis and identifies frequency on the vertical axis. Its scales should be evenly spaced and cover all bins and counts.
  • Making the intervals overlap or skip a range. Consecutive bins should meet at a boundary without sharing values. Every observed value must fall in one and only one bin.
  • Describing bar height as a data value. A bar height is a count. Say, “Four recorded weights were from 2 up to but not including 3 kilograms,” rather than suggesting the weights themselves were 4 kilograms.

For full-credit construction, show the bin boundaries and boundary convention, give a frequency count for every interval, and check that the total matches the number of observations. Then label both axes, draw touching bars at the correct heights, and describe any pattern in the context of the variable and its units.

Key takeaway: To construct a frequency histogram, cover the quantitative data with consecutive bins, assign every observation to exactly one bin using a consistent boundary rule, verify that the frequencies sum to the sample size, and draw touching bars whose heights show those counts.

Check Your Understanding

Use a consistent boundary rule and check that the bins cover every value.

  1. Using bins \([5,10)\) and \([10,15)\), which bin contains an observation equal to 10?
  2. A data set has 22 observations. What should the sum of the frequencies in its histogram bins be?
  3. Why do the bars in a histogram touch, while bars in a usual bar chart are separated?
  4. For the values 12, 15, 15, 18, and 20, find the frequencies in \([10,15)\) and \([15,20]\), with the final interval including 20.
  5. What labels should appear on the horizontal and vertical axes of a frequency histogram of plant heights measured in centimeters?