L3 Choosing the Right Chart

DATA SCIENCE · CYCLE 1 · L3 · TEXTBOOK CHAPTER

Choosing the Right Chart

Every chart is a tool with a job. A line’s job is showing change. A bar’s job is putting groups side by side. Start with the job. The picture comes second.

After this chapter, you can

Why It Matters

Pick a picture first and force the numbers into it, and you usually delete the exact thing you were trying to say. The charts you use most were each invented to do one job.

In 1786 William Playfair, a Scottish engineer, printed a book of charts about trade. Chart after chart follows England’s trade with one place, year after year. For those he drew lines across time.

Then he came to Scotland. His chart of Scotland’s trade covers one year only, from Christmas 1780 to Christmas 1781, with 17 places. One year has no change to show, so a line had no job to do. Playfair drew bars: two for each place, one for the goods coming in and one for the goods going out. It was his first bar chart. He wrote that it “does not comprehend any portion of time.” In today’s words, it covers no stretch of time.

In 1801 he had a third job. The Turkish Empire had land in three parts of the world: Europe, Asia and Africa. To show each part as a share of the whole, he cut a circle into slices. Friendly and Wainer call it the first pie chart.

What a reader had to seeThe job, in the poster’s wordsWhat Playfair drew
How England’s trade with one place changed, year after yearData Over Timea line
How Scotland’s trade with 17 places compared, in one yearComparisonsbars
What share of one empire was in each of three parts of the worldProportionsa circle cut into slices

Three things to show, three jobs, three pictures. Each time the job came first.

The Idea

The job comes first

Start with the job. The picture comes second. The job is the one thing the claim needs a reader to see. The poster calls the jobs functions.

FunctionThe claim asksA chart that does the job
ComparisonsWhich group is bigger, by how much?bar chart
ProportionsWhat share of one whole is each?pie or stacked bar
Data Over TimeHow did one thing change, in order?line chart
RelationshipsDo two measurements move together?scatter plot
DistributionWhere do the values pile up?histogram or dot plot
RangeHow far apart are the two ends?box plot or dot plot

A defense is one sentence that names the job and ties it to the claim.

A claim is a sentence that says what the data shows. You find the job by reading the claim. The data table comes after.

The wall poster and the chart chooser list 41 charts against 13 functions: Comparisons, Proportions, Relationships, Hierarchy, Location, Distribution, Patterns, Range, Data Over Time, Analyzing Text, Movement/Flow, Financial and Uncertainty/Error. The six in the table cover nearly every claim in this course. A claim about where things are needs Location. A claim that a number could be off by a lot needs Uncertainty/Error. You do not have to know all 41 charts. Start from the job, and the poster or the chooser gives you the charts that do it.

Two checks pick a chart. The variable type rules some charts out: no line through categories, no mean of a nominal variable. The job picks among what is left. L4 names the variable types.

A dot plot is on no poster row. It is a chart of one number, like a histogram or a box plot. A dot plot does the Histogram’s jobs, Distribution and Range, and keeps every value.

A Defense Names the Job

A sentence about the chartIs it a defense?
“A bar chart, because it is clear and easy to read.”No. Every chart is easy to read when it fits. Which job?
“A pie chart, because there are five categories.”No. A count of categories is no job.
“The claim is about how one number changed month to month, so the job is Data Over Time, and a line chart keeps the months in order.”Yes. It names the job and ties it to the claim.

Many claims have more than one good chart. A dot plot does Distribution and Range. A line chart does Data Over Time and Patterns. So a pick is judged by its defense.

A Real Comparison

Bar chart with bars lying on their side: the fall 2023 admit rate at five Virginia public colleges, sorted by size. George Mason 88.8%, JMU 76.2%, Virginia Tech 57.0%, William and Mary 32.7%, UVA 16.9%. UVA’s bar is the shortest.
Five colleges, one scale. The eye ranks the bars without reading a number: UVA 16.9%, George Mason 88.8%. Source: US Department of Education, IPEDS survey ADM2023. Mr. Case computed each rate: admitted divided by applied.

The figure’s claim is that UVA admitted the smallest share of its applicants of these five colleges. The claim asks which group is bigger, so the job is Comparisons. A bar chart lines the five groups up on one scale.

Read a Chart Type Backward

Knowing a chart’s job lets you spot the misuse. Every chart has a job it does well and a job people wrongly give it.

ChartJob it does wellJob people wrongly give it
Pie chartProportions: parts of one wholeData Over Time, or Comparisons among many slices of similar size
Line chartData Over Time, and PatternsComparisons across categories that are not a sequence. The line claims the space between two points means something.
Scatter plotRelationships: whether two measurements move togetherProof of cause. Moving together is no proof that one caused the other.
Scatter plot of life expectancy against GDP per capita for five countries, 2000 to 2011. Nigeria and India sit at the lower left, Brazil in the middle, Japan and the United States at the upper right. No line joins the dots.
Five countries, twelve years each: 60 dots. The job is Relationships, so each dot stands on its own and no line joins them. Source: Our World in Data, Life expectancy vs. GDP per capita, 2000 to 2011, the L5 dataset.

In a scatter plot each dot is one case. The reader looks for whether the dots rise or fall together. Here the dots rise: more income per person, longer lives. The dots show that two measurements move together. They do not show that one made the other happen.

Worked Examples

Example 1 · Same six numbers, two charts. Claim: “My screen time climbed all fall and peaked over winter break.” Average daily screen time, in hours: Sep 3.1, Oct 3.4, Nov 3.8, Dec 4.6, Jan 4.2, Feb 3.9. The phone’s Screen Time app shows a donut, so a donut is what most people picture. Pick the chart. Then show with arithmetic what the other chart hides.

The six screen time months drawn two ways. Left, a line chart that climbs from 3.1 hours in September to a peak of 4.6 in December, then falls to 3.9 in February. Right, a pie chart of the same six numbers, with slices from 13.5% to 20.0% that look about the same size.
Same six numbers. The line does the job the claim asked for. The pie does a different job, Proportions, and the claim never asked for it. The numbers are made up for this lesson.
Create a strategy

Read the claim for the job before you think about any chart. Then test the other chart with arithmetic: a pie turns each month into a share of the total, its hours ÷ the total.

Apply the idea

The claim is about a sequence: six months in order, and a peak. The job is Data Over Time, so the chart is a line chart, time across.

Now the pie. The six add to 23.0 hours. December’s slice is 4.6 ÷ 23.0 = 0.200, so 20.0%. September’s slice is 3.1 ÷ 23.0 = 0.135, so 13.5%.

MonthHoursSlice
Sep3.113.5%
Oct3.414.8%
Nov3.816.5%
Dec4.620.0%
Jan4.218.3%
Feb3.917.0%
Add23.0100.1%

The slices add to 100.1% because each one was rounded. The biggest slice and the smallest are 20.0 − 13.5 = 6.5 points apart. December and January are 20.0 − 18.3 = 1.7 points apart. Nobody can see that gap on a pie.

The line shows the climb right away: 4.6 ÷ 3.1 = 1.48, so December was 48% higher than September.

Reflect and check

Six slices between 13.5% and 20.0% all look about the same size. The pie has no way to say that December was the peak, and no way to show that the months are in order. Six months form a sequence, and a sequence has no whole to be part of. The picture threw away the only thing the claim was about.

Defense: “The claim is about a climb and a peak, so the job is Data Over Time, and a line chart keeps the months in order.”

When you build the line chart in Sheets, title it with what the numbers did, and keep the who and the when in it: My average daily screen time peaked in December, September to February.

Pies are right for some claims. Take this one: “Of everything my household threw away last week, food scraps were the biggest single share.” It is about parts of one whole. There are few categories, and one slice is clearly the biggest. That job is Proportions, and a pie chart does it.

Example 2 · A bar of an average. Claim: “The 4:15 bus is unpredictable. Most days I wait about four minutes. Every couple of weeks I wait almost twenty.” Ten mornings of waits, in minutes: 2, 3, 3, 4, 4, 5, 6, 14, 16, 18. Most students answer “a bar chart of the average.” Do the arithmetic before you agree.

Ten bus waits drawn two ways. Left, a single bar at 7.5 minutes. Right, a dot plot of all ten waits: seven dots from 2 to 6 minutes, a gap, then three dots at 14, 16 and 18. A dashed line marks the mean at 7.5, where no dot sits, and a dotted line marks the median at 4.5.
Left, the bar of the average. Right, every morning. The dashed line is the mean at 7.5, and no dot sits on it. The numbers are made up for this lesson.
Create a strategy

Find the three numbers that could stand for the ten mornings: the mean, the median and the range. Then count the mornings that match the bar.

Apply the idea

The mean is the sum divided by the count: 2 + 3 + 3 + 4 + 4 + 5 + 6 + 14 + 16 + 18 = 75, and 75 ÷ 10 = 7.5 minutes.

The median is the middle of the sorted list, or halfway between the middle two. With ten values the middle two are 4 and 5: (4 + 5) ÷ 2 = 4.5 minutes.

The range is the biggest value minus the smallest: 18 − 2 = 16 minutes.

Seven mornings were at or under 6 minutes. Three were 14 or more. On how many mornings was the wait 7.5 minutes? Zero.

Reflect and check

The mean sits in the empty gap between the two groups. A bar at 7.5 shows a number that never happened, and it hides what the claim said: the wait is unpredictable.

The claim’s job is Range, or Distribution. The poster lists both. A dot plot of all ten mornings shows the pile at 2 to 6, the three bad mornings, and the gap between them. The mean and the median describe the center. The range describes the spread.

Check it in Sheets: type the ten waits in A1 to A10, then =AVERAGE(A1:A10) in C1 and =MEDIAN(A1:A10) in C2. They show 7.5 and 4.5.

Example 3 · Find what is wrong with a chart. Claim: “In our class, students who sleep more hours tend to report lower stress.” A pair sorts eight students by hours of sleep and draws a line through them. Say what is wrong, and what chart does the job.

The pair’s chart: a line024681045678910Sleep (hours)Stress (1 to 10)6.5 hours: no student5 hours, stress 86 hours, stress 76 hours, stress 97 hours, stress 57 hours, stress 68 hours, stress 48 hours, stress 59 hours, stress 3A scatter plot: a dot for each student024681045678910Sleep (hours)Stress (1 to 10)5 hours, stress 86 hours, stress 76 hours, stress 97 hours, stress 57 hours, stress 68 hours, stress 48 hours, stress 59 hours, stress 3
Eight students, each with hours of sleep and stress from 1 to 10: (5, 8), (6, 7), (6, 9), (7, 5), (7, 6), (8, 4), (8, 5), (9, 3). The numbers are made up for this lesson.
Create a strategy

Ask two questions. First, what job does the claim need? Second, what does the chart’s shape claim on its own? A line claims that the points are a sequence, and that the space between two points means something.

Apply the idea

Each point is a different person. A line from a 6-hour student to a 7-hour student claims something about a student who sleeps 6.5 hours, and no such student exists.

The claim asks whether two measurements move together. The job is Relationships, and the chart is a scatter plot: eight dots, hours across, stress up, no line joining them.

Reflect and check

Check the other common wrong answer: two bars of means. One bar is for the students who sleep more, and one is for the students who sleep less. Two bars keep 2 numbers of the 8 students. They turn a relationship into a comparison the claim never made.

Then check the scatter plot for its own misuse. Dots falling from left to right show that sleep and stress move together. They do not show that sleeping more lowers stress. Stressed students may sleep less.

Try It: The Chart Chooser

The chart chooser is the wall poster as a web page. It asks what you are trying to show, then lists the charts that do that job.

  1. Open the chart chooser.
  2. Click Data Over Time. It lists 8 charts. Find Line Graph.
  3. Click Comparisons too. Now it lists the 4 charts that do both jobs.
  4. Click Data Over Time again to clear it.
  5. Click Comparisons again to clear it.
  6. Click Proportions. Find Pie Chart. Proportions is the only job it has.
  7. Scroll down to The whole matrix. The functions run along the top as columns, and the charts run down the side as rows. Find a function’s column, run down to each ×, then read left to the chart’s name.

The chooser uses the poster’s names. Under each name it says where you can build the chart: in Sheets, in Python, or in both. L5 teaches the steps in Sheets.

This chapter saysThe poster and the chooser sayChart type in Sheets
line chartLine GraphLine chart
bar chartBar or Stacked Bar GraphColumn chart (bars standing up), Bar chart (bars lying on their side)
scatter plotScatterplotScatter chart
pie chartPie ChartPie chart
histogramHistogramHistogram chart
box plotBox and Whisker Plotnone; Python

Sheets has no dot plot and no box plot on its list.

The Same in Python

Python comes in L19b, in Cycle 2. Once you have read it, come back and run Example 2’s ten mornings here.

In Sheets this is: =AVERAGE(A1:A10) and =MEDIAN(A1:A10).

In English:

  1. Get the pandas toolbox and call it pd.
  2. Make a column of the ten numbers, and call it waits.
  3. Print the mean of waits.
  4. Print the median of waits.

Predict: Example 2 found both by hand. What will lines 3 and 4 print? Then change the 18 to 48, say which line will change more, and run it again.

Can’t run it here? Show what it prints
7.5 4.5

With 48 in place of 18 it prints 10.5 and 4.5. One long wait moved the mean by 3 minutes. The median stayed.

In your project

Your Cycle 1 project is a month of your own data in one Google Sheet, with RAW, CLEAN, CLEANING LOG and ABOUT tabs. Its charts go into a one-page Google Doc that tells the story.

Every chart in that Doc starts from a claim. Read the claim, name the job, then pick the chart. THE SHAPE of your question points to the job.

THE SHAPEJob (function)In Sheets
A trend over timeData Over TimeLine chart
A comparison between groupsComparisonsColumn chart, or Bar chart when the names are long
Two numbers togetherRelationshipsScatter chart
A single numberData Over Time, for nowA Line chart of your days in order

A label or a 1 to 5 rating gets a Column chart of counts: one bar for each label, and no line through the ratings.

The Data Cycle Rubric asks that every chart’s type fits the job. Be ready to defend each chart in one sentence that names the job.

Check Yourself

Answer each one before you look. The first two are from L1 and L2, so you keep them.

A student asks: “Over four weeks, do I sleep more hours on weekend nights than on school nights?” What is THE SHAPE of the answer? L1

A library lent 480 books in September and 600 in October. Find the percent change. L2

Claim: “Rent takes the biggest share of my family’s spending each month.” Which function does the claim need?

Claim: “My daily steps climbed all spring and peaked in June.” Average daily steps, in thousands: Mar 7.0, Apr 7.5, May 8.0, Jun 9.5, Jul 9.0, Aug 9.0. The six add to 50.0. As a pie, what percent is June’s slice?

Eight pizza deliveries took 18, 20, 21, 22, 24, 25, 48 and 54 minutes. Someone draws one bar at the mean. At how many minutes does the bar stand?

The same eight deliveries. Claim: “Delivery is usually quick, but some nights it takes twice as long.” Which chart does the job?

Each sentence gives a chart a job. Which sentence gives the chart a job it cannot do?

Claim: “The price of a school lunch rose every year from 2019 to 2026.” Which sentence is a defense of the chart?

Open the chart chooser. Click Distribution, then click Range too. How many charts do both jobs?

Read More

UK Government Analysis Function, Data visualisation: charts. A free guide for people in the UK government who design and publish charts. Read the part called Choosing the right chart. It starts where this chapter starts: decide the message, then pick the chart. Its table matches nine jobs to charts. It calls the jobs statistical relationships, and some of its names differ from the poster’s: Time series is Data Over Time, Correlation is Relationships, and Part-to-whole is Proportions. Then read Using pie charts, which gives three rules for when a pie is right.

Stuck on any of this? Ask Mr. Case in class or send him a message in Canvas. Name the example or the question number, and say which step lost you.