How do you compare histograms with unequal bin widths?
When histogram bins have unequal widths, use density heights so bar areas represent counts or proportions. Frequency density is count divided by bin width; relative density also divides by the total observations. Label the units and boundaries, check the areas, and do not infer the distribution inside a wide bin from its average height.
The short answer
When histogram bins have unequal widths, use density heights so bar areas represent counts or proportions. Frequency density is count divided by bin width; relative density also divides by the total observations. Label the units and boundaries, check the areas, and do not infer the distribution inside a wide bin from its average height.
Key takeaways
- With unequal bin widths, count heights can distort the visual comparison.
- Relative-density bar areas sum to one; their heights generally do not.
- A bin’s density is not the probability of one exact observed value.
- Grouped data cannot reveal the exact location of observations inside each interval.
An operations report groups completion times into zero to five, five to fifteen and fifteen to forty-five minutes. The first group contains forty cases; each of the other groups contains thirty. If the chart uses counts as bar heights while preserving the different interval widths, the final bar occupies far more area than its share of cases warrants.
The problem is geometric. A histogram represents a continuous measurement along the horizontal axis, so unequal widths must be reflected in the height calculation if areas are to represent frequencies.
Decide what the vertical axis represents
Three useful quantities are the count in a bin, the proportion of observations in it and the density per unit of horizontal width. They answer related but different questions.
The NIST histogram reference distinguishes normalization by sample size from normalization by both sample size and class width. With the latter, the total area under the histogram equals one. The numerical example here applies that relationship to an operating report.
If you want a categorical comparison of counts in named groups, a bar chart with equal-width categories can show it, provided the labels make the unequal intervals clear. Do not present that categorical layout as a time axis with evenly spaced values.
Calculate the bin widths and densities
Use a fictional set of one hundred completed cases. The intervals have widths of five, ten and thirty minutes. Assign boundary values consistently: five minutes enters the second bin, fifteen enters the third, and forty-five is included in the final bin for this illustration.
| Time interval | Count | Width in minutes | Count density | Relative density |
|---|---|---|---|---|
| 0 to under 5 minutes | 40 | 5 | 8 per minute | 0.08 per minute |
| 5 to under 15 minutes | 30 | 10 | 3 per minute | 0.03 per minute |
| 15 to 45 minutes | 30 | 30 | 1 per minute | 0.01 per minute |
Count density divides each count by its width. Relative density divides again by the total of one hundred observations. Use the relative-density column as bar heights when the area should represent the fraction of observed cases.
The first bar’s area is 0.08 multiplied by five, or 0.40. The next two areas are 0.30 each. Together they sum to one, matching the complete observed sample.
See what goes wrong with count heights
Using the raw counts as heights produces areas of two hundred, three hundred and nine hundred. The final interval would occupy approximately 64.3 percent of the total geometric area even though it contains thirty percent of cases.
A reader judging the visual mass could conclude that most cases lie in that interval. The labels might still show the correct counts, but the geometry would communicate a different comparison.
Changing to density does not change the underlying observations. It changes how the unequal widths encode them. Keep the count table available so readers can inspect both the frequency and the distributional display.
Interpret height and area correctly
A relative density of 0.08 per minute does not mean that eight percent of cases took exactly one particular minute. The bin contains forty percent across its five-minute width.
Nor does a flat rectangle prove that observations are evenly distributed inside the interval. They might cluster near one boundary. The rectangle summarizes grouped information; it does not recover detail that the grouping removed.
Density values can exceed one when units or narrow intervals make that appropriate. Probability is represented by area, not by requiring every height to remain below one. Always label the horizontal unit and the vertical density unit together.
Avoid invented precision within a bin
The example establishes that seventy cases took less than fifteen minutes. It does not reveal how many took less than ten minutes because the middle interval spans that threshold.
Assuming half of the middle bin lies below ten would impose a within-bin distribution that the grouped data do not establish. An interpolation may be useful as an explicit model, but it should not be reported as an observed count.
Likewise, the median lies in the middle interval under this grouping, but its exact value is unavailable. If the decision depends on a ten-minute service threshold, obtain raw observations or counts aligned to that threshold rather than deriving a precise answer from the wrong bins.
Compare periods with compatible scales
For a before-and-after comparison, use the same unit, interval boundaries and vertical normalization where possible. Different bin definitions can make unchanged data appear to have a different shape.
Relative density helps compare distributions when sample sizes differ, but it deliberately removes the difference in total volume. A period with many more cases can have the same relative shape while creating much more workload.
Show total observations and the collection period alongside the distribution. Check whether incomplete cases, exclusions or changed measurement systems alter the comparison. Sampling bias is not repaired by a correctly normalized chart.
Choose bins for the decision and test the display
Operational thresholds may justify unequal intervals, but explain that choice. Check a second reasonable grouping when the apparent shape drives a consequential interpretation. Very wide intervals can hide variation; very narrow ones can emphasize noise in a small sample.
Use a key assumptions check for boundaries, missing observations, units and the meaning of the population. Avoid open-ended density bins without a finite width: a final category such as forty-five minutes or more can be reported separately or resolved with additional data.
The guides on checking research-workflow claims and archiving evidence help preserve the calculation and its limits. Include the count table, density formula and interpretation in the executive editor, with related methods in the evidence and research methods hub.
Sources & further reading
- NIST/SEMATECH: Histogram
Distinguishes count and relative-frequency normalization from normalization by sample size and class width, for which total histogram area equals one.