Grade by Grade
D. Statistical Analysis · One-Variable Data Analysis

Histograms, Frequency Polygons, Ogives and Stem-and-Leaf Plots

D1.3About 70 minutes
Learning goals
  • I can draw a histogram and a relative-frequency histogram from a grouped frequency table.
  • I can draw a frequency polygon and a cumulative frequency graph (ogive).
  • I can estimate the median and percents from an ogive.
  • I can make and read stem-and-leaf plots, including back-to-back plots for comparing two data sets.

Words to know

histogram
A graph of grouped numerical data. Each class is a bar on a continuous horizontal scale; the bars touch, and each bar's height is the class frequency (or relative frequency).
frequency polygon
A line graph that joins the points (class midpoint, frequency), closed off at zero one class width beyond each end.
cumulative frequency graph (ogive)
A line graph that joins the points (upper class boundary, cumulative frequency). It always rises from 0 to n.
stem-and-leaf plot
A display that splits each value into a stem (leading digits) and a leaf (last digit), keeping every original value while showing the shape.
back-to-back stem-and-leaf plot
Two stem-and-leaf plots sharing one column of stems, with leaves for one data set on the left and the other on the right.

From a table to a picture

A fisheries biologist measures 40 brook trout from a lake in Algonquin Park. A table of 40 lengths is hard to read, but a graph shows the distribution at a glance: where the lengths cluster, how spread out they are, and whether a few fish are unusual.

In Grade 9 you drew histograms and stem-and-leaf plots. This lesson adds relative-frequency histograms, frequency polygons and cumulative frequency graphs (ogives), which are the tools used with large data sets and with the probability models of the unit Continuous Distributions and the Normal Distribution.

Drawing a histogram

  1. Make a grouped frequency table with equal class widths (as in lesson 1).
  2. Put the variable on the horizontal axis with an even, continuous scale. Mark the class boundaries.
  3. Put frequency (or relative frequency) on the vertical axis, starting at 0.
  4. Draw a bar for each class. The bars touch because the classes cover a continuous number line. Leave a gap only where a class has frequency 0.
  5. Title the graph and label both axes with units.

A relative-frequency histogram uses f ÷ n on the vertical axis. It has exactly the same shape; only the scale changes. Use it to compare data sets of different sizes, and it is the link to probability: the relative frequency of a class estimates the probability that a randomly chosen individual is in that class.

Worked example

Example 1: Histogram and frequency polygon

The 40 trout lengths are grouped as [18, 22): 2, [22, 26): 6, [26, 30): 11, [30, 34): 12, [34, 38): 6, [38, 42): 3. Describe how to draw the histogram and the frequency polygon, and find the relative frequencies.

  1. Histogram: horizontal axis from 18 to 42 cm with boundaries every 4 cm. Bars of heights 2, 6, 11, 12, 6, 3, touching.
  2. Midpoints: 20, 24, 28, 32, 36, 40.
  3. Frequency polygon: plot (20, 2), (24, 6), (28, 11), (32, 12), (36, 6), (40, 3). Add a point with frequency 0 one class width beyond each end, at (16, 0) and (44, 0), and join all the points with straight segments.
  4. Relative frequencies: divide by 40: 0.05, 0.15, 0.275, 0.30, 0.15, 0.075 (they add to 1 ✓).

The graph below shows both. The polygon is closed off at 0 so that the area under it equals the total area of the bars.

Lengths of 40 brook trout: histogram and frequency polygon141822263034384246024681012length of brook trout (cm)frequency
The histogram bars touch. The frequency polygon joins the tops of the bars at their midpoints, and drops to 0 one class width beyond each end (at 16 cm and 44 cm).

Why close the polygon at zero?

Each triangle the polygon cuts off a bar is matched by an equal triangle it adds above the neighbouring gap, so the area under the polygon equals the total area of the bars. Closing at zero keeps that true at both ends. Frequency polygons are also handy for drawing two distributions on one set of axes, which is messy with overlapping bars.

Cumulative frequency graphs (ogives)

An ogive (pronounced OH-jive) answers "how many values are below a given number?"

  • Plot (upper boundary of each class, cumulative frequency). Start with (lowest boundary, 0).
  • Join the points with straight segments. The graph never goes down, and it ends at n.
  • To estimate the median, find n ÷ 2 on the vertical axis, go across to the graph, then down to the horizontal axis. The same method estimates any percentile (lesson 8 does more of this).

The estimate assumes the values are spread evenly within each class, which is why it is only an estimate.

Worked example

Example 2: Reading an ogive

Use the trout table to (a) list the ogive points, (b) estimate the median length, and (c) estimate how many trout are shorter than 36 cm.

  1. (a) Cumulative frequencies 2, 8, 19, 31, 37, 40. Points: (18, 0), (22, 2), (26, 8), (30, 19), (34, 31), (38, 37), (42, 40).
  2. (b) n ÷ 2 = 20. The cumulative frequency passes 20 between (30, 19) and (34, 31). It rises 12 over those 4 cm, and we need 1 more than 19, so go 1/12 of the way across the class: 30 + (1/12)(4) ≈ 30.3 cm.
  3. (c) 36 cm is halfway between 34 and 38, where the cumulative frequency goes from 31 to 37. Halfway: 31 + 3 = 34 trout (about 85%).

Median ≈ 30.3 cm; about 34 of the 40 trout are shorter than 36 cm. (The biologist's full list of 40 lengths, not shown here, has 30.0 cm and 30.4 cm as its 20th and 21st values, so the true median is (30.0 + 30.4) ÷ 2 = 30.2 cm, very close to the estimate.)

Cumulative frequency graph (ogive) for the trout182226303438420510152025303540length of brook trout (cm)cumulative frequencyhalf of 40 = 20median ≈ 30.3 cm
Go across from half of n (20) to the ogive, then down. The median is about 30.3 cm. An ogive always rises from 0 to n.

Stem-and-leaf plots

A stem-and-leaf plot keeps every original value and still shows the shape. For two-digit data the tens digit is the stem and the units digit is the leaf. Always include a key (for example, 7 | 2 means 72), order the leaves, and line them up in columns so the rows act like sideways bars.

To compare two data sets, use a back-to-back plot: one shared column of stems, one data set's leaves to the right and the other's to the left. On the left side, leaves increase going away from the stem (read them right to left).

If most values fall on a few stems, split each stem in two: 7 (leaves 0 to 4) and 7* (leaves 5 to 9).

Worked example

Example 3: Back-to-back stem-and-leaf plot

Two Grade 12 classes wrote the same test.

Class A: 52, 58, 61, 64, 65, 67, 70, 71, 72, 74, 75, 76, 78, 79, 81, 83, 85, 88, 91, 96

Class B: 45, 49, 53, 56, 60, 62, 62, 66, 68, 69, 71, 73, 74, 77, 80, 82, 87, 90, 94, 98

Make a back-to-back stem-and-leaf plot and compare the classes.

  1. Stems 4 to 9 cover both sets (45 to 98).
  2. Class B leaves go on the right in increasing order: stem 6 has 0 2 2 6 8 9.
  3. Class A leaves go on the left, increasing away from the stem: stem 7 reads 9 8 6 5 4 2 1 0 from left to right.
  4. Compare: Class A has its biggest row at 70s (8 marks) and no marks below 50. Class B is more spread out (45 to 98) with its biggest row in the 60s. Both medians: A = (74 + 75) ÷ 2 = 74.5; B = (69 + 71) ÷ 2 = 70.

Class A did better in the middle (median 74.5 vs 70) and was more consistent; Class B had both the lowest and the highest marks.

Test marks: back-to-back stem-and-leaf plotClass A leavesStemClass B leaves4598253675416022689986542107134785318027619048Key: 2 | 7 | 3 means 72 in Class A and 73 in Class B
Back-to-back stem-and-leaf plot. Read Class A leaves from the stem outward: the 7 row on the left holds 70, 71, 72, 74, 75, 76, 78 and 79.
Just for fun

Gardeners and statisticians both love stems and leaves. The difference: a statistician's leaves never fall off in October. A stem-and-leaf plot keeps every value all year.

A word about class width

The same data can look different with different class widths. Very wide classes hide the shape in a few tall bars; very narrow classes make a jagged picture full of gaps. Technology (Desmos, a spreadsheet, or a statistics package) makes it easy to try several widths before you choose. The unit Continuous Distributions and the Normal Distribution studies this effect more closely.

Hands-on activity

Coin spins: make a histogram and an ogive

You need: a coin, a timer (a phone stopwatch), paper and a pencil. A helper is useful.

  1. Spin a coin on its edge on a hard table and time how long it spins until it lies flat, to the nearest tenth of a second. Do this 30 times. (If spinning is hard, instead time 30 tries at saying the alphabet backwards.)
  2. Group the times into 5 to 7 equal classes and make a frequency table with cumulative frequency.
  3. Draw a histogram, a frequency polygon (on the same axes) and an ogive.
  4. Use the ogive to estimate the median time. Then find the true median from your sorted data and compare.

What to look for: bars that touch, a polygon closed at 0 beyond both ends, and an ogive that rises from 0 to 30 at the upper boundary of the last class. Your ogive estimate of the median should be within about half a class width of the true median.

Your turn

1

A grouped table has classes [0, 10), [10, 20), [20, 30), [30, 40) with frequencies 4, 9, 5, 2. Give the points of the frequency polygon, including the end points.

2

For the same table, give the points of the ogive.

3

Use the ogive in the previous question to estimate the median.

4

Write the stem-and-leaf plot for 31, 35, 38, 42, 42, 47, 50, 53, 59 with a key.

5

Why do histogram bars touch but bar graph bars do not?

6

A relative-frequency histogram has bars of height 0.1, 0.25, 0.4, 0.15 and one more bar. What is the height of the last bar?

More practice: warm-up

1

Find the midpoint of the class [26, 30).

2

What is the last cumulative frequency in a table of 75 values?

3

In a stem-and-leaf plot with key 6 | 4 = 64, what value does 8 | 0 represent?

4

What is a cumulative frequency graph also called?

5

Can a cumulative frequency graph ever go down?

More practice: on your own

1

The ogive of 200 waiting times passes through (10, 46), (15, 112) and (20, 160). Estimate (a) how many waits were 15 min or more, (b) the median wait.

2

Make a back-to-back stem-and-leaf plot: Team X points 12, 15, 21, 24, 24, 30; Team Y points 9, 18, 19, 22, 27, 33, 35.

3

A histogram of 50 values has bars of heights 3, 8, 15, 12, 9 and 3. Sketch the matching relative-frequency histogram by giving its bar heights.

4

Explain why a frequency polygon can be better than two histograms for comparing two classes' test marks.

5

The scores 61, 62, 63, 64, 66, 67, 68, 68, 69 all share stem 6. Draw a split-stem plot.

Challenge

1

An ogive for 120 values passes through (40, 18), (50, 54), (60, 90), (70, 111), (80, 120), and starts at (30, 0). Reconstruct the frequency table and identify the modal class.

2

A student draws a histogram of household incomes with classes $0–$20 000, $20 000–$40 000, $40 000–$100 000 and $100 000–$200 000, using bar height = frequency. Explain the problem and how to fix it.

3

For the trout data, use the ogive to estimate the 25th percentile (the length with 25% of the fish shorter). Then find it using the quartile method (the median of the lower half), given that the 10th and 11th smallest lengths in the full list are 26.5 cm and 27.0 cm.

Check your understanding

Quiz

1.

In a histogram, why do the bars touch?

2.

A frequency polygon plots which points?

3.

An ogive for 60 values passes through (20, 24) and (30, 36). What is the best estimate of the median?

4.

What is the main advantage of a stem-and-leaf plot over a histogram?

5.

A relative-frequency histogram and a frequency histogram of the same data have

6.

In a back-to-back stem-and-leaf plot, the left leaves for stem 5 read 8 6 3 1. Which values are they?

For parents and teachers

Big idea (D1.3): histograms, frequency polygons and ogives are three views of the same grouped table. Histograms show shape, polygons compare groups on one set of axes, and ogives answer "how many are below?" questions and estimate the median.

How to help: Graph paper and a ruler are still worth using once or twice, even though technology does the drawing later. Ask your teen to explain each point they plot: "Why is this point at 34 and not 32?" (ogives use upper boundaries; polygons use midpoints).

Common difficulties:

  • Plotting ogive points at midpoints instead of upper boundaries.
  • Forgetting the starting point (lowest boundary, 0) of the ogive or the zero points of the polygon.
  • Writing left-side leaves in a back-to-back plot in the wrong direction.
  • Using unequal class widths without adjusting the bar heights.