Tutorials › Introduction to Statistics › Histograms With Unequal Bin Widths

Graphs for Quantitative Data · Tutorial 130 of 996

Histograms With Unequal Bin Widths

Learn to construct and interpret unequal-width histogram bins by making bar area, rather than height alone, represent the number of observations.

Beginner 9 min read

What You'll Learn

  • Explain why bar height alone cannot represent frequency when bin widths differ.
  • Calculate frequency density from a bin’s frequency and width.
  • Construct unequal-width histogram bars whose areas represent observed counts.
  • Recover a bin’s frequency from its width and histogram height.
  • Compare frequencies by comparing bar areas, not just heights.

Why Unequal Bin Widths Need Special Care

A histogram groups quantitative observations into intervals and represents the observations in each interval with a bar. When all intervals have the same width, a taller bar also has a larger area, so height and frequency give the same ordering. With unequal widths, that shortcut fails: a wide, relatively short bar can contain more observations than a narrow, tall one.

The solution is to choose bar heights so that bar area represents frequency. The height is then frequency density: frequency per unit of the measured variable. This tutorial uses hypothetical waiting times, measured in minutes, to show how to calculate the heights, construct the bars, and read the resulting display.

Definition: For a histogram bin with width \(w\) and frequency \(f\), the frequency density is \(f/w\). In a histogram with unequal bin widths, use frequency density as bar height. The bar’s area is width multiplied by height, so it equals \(w(f/w)=f\), the bin’s frequency.

From a Grouped Distribution to Bar Heights

Suppose waiting times are recorded in minutes. A bin from 0 to less than 2 minutes has width \(2\) minutes; a bin from 2 to less than 5 minutes has width \(3\) minutes. In general, for an interval from \(a\) to less than \(b\), its width is \(b-a\). The intervals should cover the data being displayed without overlapping. Assigning a boundary value consistently—for example, using intervals closed on the left and open on the right—ensures that each observation is counted in exactly one bin.

If the vertical axis is labelled “frequency density (observations per minute),” multiply a bar’s height by its width in minutes to obtain its frequency. The units explain the calculation: minutes multiplied by observations per minute gives observations. The numerical height alone is not a count.

Worked Example: Constructing a Waiting-Time Histogram

A hypothetical clinic groups 74 waiting times, in minutes, into the following intervals. The intervals are treated as left-closed and right-open, so, for example, a waiting time of exactly 2 minutes belongs in the second bin.

Waiting-time interval (minutes)Width (minutes)Frequency (observations)Frequency density (observations per minute)
0 to less than 22189
2 to less than 53248
5 to less than 94205
9 to less than 156122

First check the widths by subtracting each lower endpoint from its upper endpoint: \(2-0=2\), \(5-2=3\), \(9-5=4\), and \(15-9=6\) minutes. The stated frequencies sum to \(18+24+20+12=74\), consistent with the total number of waiting times.

For the first bin, the frequency density is

$$ \frac{f}{w}=\frac{18\ \text{observations}}{2\ \text{minutes}} =9\ \text{observations per minute}. $$

The other heights are \(24/3=8\), \(20/4=5\), and \(12/6=2\) observations per minute. To draw the histogram, put waiting time (minutes) on the horizontal axis and frequency density (observations per minute) on the vertical axis. Draw adjacent bars over the four intervals, with heights 9, 8, 5, and 2. Their areas are \(2(9)=18\), \(3(8)=24\), \(4(5)=20\), and \(6(2)=12\) observations, respectively.

The first bar is tallest, but the second bar has the largest area and represents the largest frequency. In context, 24 of the 74 hypothetical waiting times fall from 2 to less than 5 minutes; the bar’s height of 8 observations per minute is not itself the number of waiting times.

Why Area, Rather Than Height, Represents Frequency

The area rule follows directly from the requirement that each bar represent its bin’s count. Let \(w_i\) be the width of bin \(i\), \(f_i\) its frequency, and \(h_i\) its height. A rectangle’s area is \(w_i h_i\). To make this area equal to the frequency, set \(w_i h_i=f_i\) and solve for the height.

$$ w_i h_i=f_i \qquad\Longrightarrow\qquad h_i=\frac{f_i}{w_i}. $$

This calculation is the justification for frequency density, not just a plotting convention. If we used frequency itself as the height, the area would be \(w_i f_i\), which changes with the bin width. That would give wider intervals extra area even when their counts were the same.

For the waiting-time data, the 2-to-less-than-5-minute bar has area \(3\text{ minutes}\times8\text{ observations per minute}=24\) observations. The 9-to-less-than-15-minute bar has area \(6\text{ minutes}\times2\text{ observations per minute}=12\) observations. Their heights differ, and their widths differ, but each area recovers its bin’s count.

Worked Example: A Lower Bar Can Represent More Observations

In the hypothetical waiting-time distribution, compare the 0-to-less-than-2-minute bin with the 2-to-less-than-5-minute bin. Which bin contains more observations, and how can the answer be read from the histogram?

The first bin’s height is \(18/2=9\) observations per minute. Its area is

$$ 2\ \text{minutes}\times 9\ \text{observations per minute} =18\ \text{observations}. $$

The second bin’s height is \(24/3=8\) observations per minute. Its area is

$$ 3\ \text{minutes}\times 8\ \text{observations per minute} =24\ \text{observations}. $$

The first bar is taller, since \(9>8\), but the second bar has the larger area, \(24>18\). Therefore, the 2-to-less-than-5-minute bin contains six more waiting times. Comparing heights alone would give the wrong answer.

Reading Areas and Recovering Counts

When a histogram is provided without a frequency table, the area rule still applies. If the bin endpoints and the vertical-axis scale are available, find a bar’s width, read its height as frequency density, and multiply. This recovers the frequency represented by that bar. If heights are given in plotted units rather than numerical density values, first use the axis scale to determine the actual density.

The same principle applies if a histogram represents relative frequency rather than counts. In that case, bar area represents relative frequency: the proportion of observations in the bin. The vertical-axis label must make clear which kind of density is being displayed. For the worked distribution here, heights use frequency density, so areas represent counts.

Worked Example: Recovering Frequency From a Bar

Suppose a histogram of hypothetical waiting times shows a bar from 5 to less than 9 minutes with a height of 5 observations per minute. Find the number of observations in that interval.

The width is \(9-5=4\) minutes. Multiply that width by the density:

$$ f=w h =(4\ \text{minutes})(5\ \text{observations per minute}) =20\ \text{observations}. $$

Thus, 20 hypothetical waiting times fall from 5 to less than 9 minutes. This agrees with the grouped distribution above. A height of 5 observations per minute does not mean that the interval contains 5 observations; it represents 20 because its width is 4 minutes.

A Reliable Construction Process

A consistent sequence helps prevent width and height from being confused. Before drawing, check that every interval’s frequency comes from the same data set and that all widths use the same measurement unit.

1
List the intervals and frequencies.
Record the lower and upper endpoints of each bin and the number of observations in it. Confirm that each observation is assigned to one bin.
2
Calculate each width.
For a bin from \(a\) to \(b\), calculate \(w=b-a\). Keep the measurement unit, such as minutes.
3
Calculate each density.
Divide the bin’s frequency by its width: \(h=f/w\). Label the vertical axis with the resulting units, such as observations per minute.
4
Draw and check the bars.
Give each bar the horizontal span of its interval and the calculated height. Check that width multiplied by height recovers its frequency.

The final check is especially useful when intervals have different widths: calculate each area, not just each height. The areas should match the listed frequencies, and their sum should match the total number of observations.

Common Mistakes and Why the Display Matters

  • Using frequency as the height. This makes wider bins have larger areas for reasons unrelated to their counts. Use \(f/w\) as the height when bar area is to represent frequency.
  • Comparing bar heights as though they were counts. With unequal widths, height is a rate per unit of the horizontal measurement. Compare areas to compare frequencies.
  • Leaving off the density units. A vertical value such as 8 means 8 observations per minute in the waiting-time example, not 8 observations in the bin.
  • Using inconsistent width units. If one width is in minutes and another is mistakenly calculated in hours, their densities cannot be compared as written. Calculate all widths in the same unit.
  • Forgetting the endpoint convention. Overlapping intervals or gaps can lead to observations being counted twice or not at all. State a consistent convention for values on bin boundaries.

This distinction matters whenever intervals are chosen to have different widths. The histogram should communicate how observations are distributed, not make a count look larger or smaller simply because its interval is wider or narrower. A bar’s height describes frequency per unit of measurement; its area gives the frequency represented by the bin.

Key takeaway: For unequal-width bins, set each bar’s height to frequency divided by bin width. Then width multiplied by height equals frequency, so compare bar areas—not heights alone—to compare how many observations fall in different bins.

Check Your Understanding

Use the definitions and area rule to answer these questions.

  1. A bin from 4 to less than 10 minutes contains 30 observations. What are its width and frequency density?
  2. A bar is 5 minutes wide and has height 3 observations per minute. How many observations does its area represent?
  3. One bin has width 2 minutes and density 7 observations per minute. Another has width 4 minutes and density 4 observations per minute. Which contains more observations? Show the area calculation.
  4. Why is it generally incorrect to use frequency itself as the height of every bar when bin widths differ?
  5. A histogram’s vertical axis is labelled “observations per minute.” What does the height of a bar represent, and what does its area represent?