Histograms: How to Make and Read Them
Learn how to make a histogram, handle bin edges, read frequency and density, and compare bar areas when bin widths differ.
TL;DR
A histogram shows how numerical data are distributed across intervals called bins. With equal-width bins, compare counts by bar height. With unequal widths, use frequency density so each bar’s area represents its count.
Key Points
- Put numerical ranges on the horizontal axis and label what the vertical axis measures.
- Choose boundaries that assign each observation to exactly one bin.
- Use bar area to interpret a histogram with unequal bin widths.
- Inspect the shape, centre, spread, and gaps. Different bin choices can make the same data look different.
- A bar chart compares categories. A histogram groups a numerical scale.
What is a histogram?
A histogram groups observations into numerical intervals, called bins, and displays each interval as a rectangle. For example, a teacher might group quiz completion times into 0–10 minutes, 10–20 minutes, and 20–30 minutes. Each observation goes in one interval, and the chart shows where observations cluster.
The bins follow the order of the number scale. Adjacent bins meet at the boundary they share. A bin with no observations has zero height and may appear as a gap. The horizontal axis shows measurement units, such as minutes. The vertical axis may show count, relative frequency, or frequency density. NIST, Histogram
How do you make a histogram from raw data?
- Choose a numerical range. Include the minimum and maximum observed values.
- Choose bins. For a first chart use equal-width intervals with boundaries suited to the units.
- Specify endpoint rules. The interval includes 10 and excludes 20. Some tools include the right endpoint of the final bin. Use that convention consistently if you adopt it.
- Tally counts. Assign each observation to exactly one interval. Their counts should add to the sample size.
- Plot and label. Use touching rectangles for neighbouring intervals and label the units and frequency scale.
Probe how the appearance changes if you make the bins wider or narrower. Wide bins can hide two separate clusters. Narrow bins can make a small sample look erratic. When comparing two groups, use the same bins and consider relative frequency if the sample sizes differ. OpenStax, Histograms and Frequency Polygons
Which heights work for counts, proportions, and unequal bin widths?
Let the bin contain observations, have positive width , and be part of a sample of size .
| What the chart shows | Height or displayed value | When to use it |
|---|---|---|
| Frequency | Compare counts for equal widths | |
| Relative frequency | Compare fractions of a sample when widths are equal | |
| Frequency density | Preserve counts as areas when widths differ | |
| Relative frequency density | Preserve proportions as areas when widths differ | |
| Cumulative frequency | Sum of counts up through a boundary | Answer “how many fall before this threshold?” |
A density bar’s width times height gives its count or proportion. With relative frequency density, all bar areas add to 1. The vertical scale can include values above 1 if the bin widths are small. The individual height has units of inverse measurement units, and area represents a proportion. OpenStax, Encoding Univariate Data
A cumulative frequency display has a nondecreasing total. It can answer questions about the fraction of observations below a boundary. Read its height as a running sum. For readers comparing an empirical chart with a model, the probability distribution guide explains why area matters for continuous probability.
How do you read the shape of a histogram?
Look for the main cluster, the direction of any long tail, and the number of visible peaks. A symmetric pattern looks roughly balanced on both sides of its centre. A right-skewed pattern has a tail toward higher values, and a left-skewed pattern has a tail toward lower values. Bimodal means two peaks. A roughly uniform pattern has similar heights or densities across its range. The right-skewed histogram guide shows how a tail differs from the location of the tallest bars.
Check the axis and bin width before describing the pattern. The same sample can appear to have one or two peaks at different resolutions. A histogram can suggest an unusual gap or value range. Exact observations within a bin usually require the raw data. OpenStax, Data Visualization and Graphical Displays
Worked Histogram Examples
Example 1
Bin these ten completion times into , , and minutes: 4, 6, 7, 10, 13, 14, 15, 19, 20, 22.
- The first bin has 4, 6, and 7, for a count of 3.
- The second bin has 10, 13, 14, 15, and 19, for a count of 5.
- The last bin has 20 and 22, for a count of 2. Use heights 3, 5, and 2 because the widths match.
Example 2
Convert Example 1 to relative frequencies.
- Divide each interval count by 10.
- The heights are 0.30, 0.50, and 0.20.
- They add to 1. Half of the sample takes at least 10 minutes and less than 20 minutes.
Example 3
Using the same data, find the cumulative frequency before 20 minutes.
- The first two bins end at or before the 20-minute edge.
- Add their counts, .
- Eight observations are below 20. The observation at exactly 20 belongs to the next bin.
Example 4
A histogram uses and , with counts 12 and 18 respectively. Calculate the frequency densities.
- The widths are 5 and 10.
- The heights are and .
- The shorter-width bar is taller. Its area is still smaller because and .
Example 5
A relative frequency density bar covers and has height 0.06 per unit. What fraction of the data lie in that bin?
- Use its width, units.
- Multiply by its height to get .
- This represents 30% of observations. For a sample of 50, that is 15 observations.
Example 6
A display shows 9 bus, 6 walk, and 4 bike responses. Would a histogram make sense?
- The labels are travel categories.
- There are no numerical bin boundaries.
- Use a bar chart. If the same survey recorded commute time in minutes, a histogram could show those times.
Mistakes That Change a Histogram
Mistake 1: Counting a boundary value in two bins
With and , put 10 in the second interval. Set the endpoint rule before tallying.
Mistake 2: Treating height as count when widths and densities vary
Read the axis label. For frequency density, recover the count using width times height.
Mistake 3: Inferring exact values from grouped data
A count of five between 10 and 20 says how many values fall there. It does not recover the five separate measurements.
Try It Yourself
- Use , , and for the data 2, 4, 4, 6, 8, 11. Find the bin counts.
- A bin of width 4 has frequency density 2.5. Find its count.
- A sample has 18 of 60 observations in one equal-width bin. Find that bin’s relative frequency.
Answers and Reasoning
- The counts are 1, 3, and 2. A value at 4 belongs to the second interval, and 8 belongs to the third.
- The count is .
- , which is 30%.
Frequently Asked Questions
Why do bars usually touch?
Adjacent bins represent neighbouring stretches of a continuous numerical scale. A zero-count interval still occupies its place on that scale.
How is a histogram different from a frequency polygon?
A histogram uses rectangles over bins. A frequency polygon usually plots frequencies at successive class midpoints and connects those points with line segments.
Is the tallest bin always the mode?
It gives the location of the highest density when the chart is properly scaled. The exact most frequent value can differ or be impossible to recover from the grouped counts.
Conclusion
- Choose bins and endpoints that account for each observation once.
- Read the vertical axis before turning a bar into a count or share.
- Use the chart to describe the distribution and check which details depend on bin choices.