Skip to content

A chart that makes the point

Decide what a chart is for, write a title that says it, make four edits that do most of the work, show the data when you can, and use the note for the fine print.

Applied ~11 min11 steps

What runs in CodeSplash

You will be able to

  • Tell a chart for exploring from a chart for explaining
  • Write a title that states the finding when the venue allows it
  • Edit a chart so that one point stands out, and note what a reader needs

Read first

01

Exploring isn't explaining

Read

You made dozens of charts while you worked, to find things out. Those were for you, so a default title and a legend were fine.

A chart in a report has a different job. It's there to show someone else one thing you found, and they weren't with you when you found it.

So before you polish anything, finish this sentence: "This chart shows that…". If you can't, it isn't ready to be shared. If you need "and" twice, it's probably two charts.

02

Which title?

Predict

Predict first

A chart goes in an executive summary. Which title is most useful there?

Tooth length by supplementFigure of the ToothGrowth t testOrange juice gave longer teeth on average, but the groups overlap
Reveal

The third. It's an action titleAction titleA chart or slide title that states the finding, so that the reader knows what to see and can check it.: it tells a reader what to see, and they can check it against the picture. For a journal, follow its style. APA figure titles describe the content, so the finding goes in your text.

03

Find the one point

Explore

This chart shows each group's observations and, on its own axis, the difference between them with its interval.

Estimation plot (Gardner–Altman)How big is the difference between two groups, and how precisely is it estimated?
View data
lengthsupplementdifferencediff lowdiff high
26.800VC2.123−2.1526.398
4.900VC2.123−2.1526.398
21.900VC2.123−2.1526.398
30.500VC2.123−2.1526.398
12.200VC2.123−2.1526.398
30.700VC2.123−2.1526.398
28.100VC2.123−2.1526.398
7.600VC2.123−2.1526.398
3.300VC2.123−2.1526.398
19VC2.123−2.1526.398
29.800VC2.123−2.1526.398
33.500VC2.123−2.1526.398
8VC2.123−2.1526.398
12.700VC2.123−2.1526.398
33.100VC2.123−2.1526.398
20.200VC2.123−2.1526.398
18.200VC2.123−2.1526.398
20.300VC2.123−2.1526.398
23.400VC2.123−2.1526.398
26.800VC2.123−2.1526.398
29.700VC2.123−2.1526.398
18.800VC2.123−2.1526.398
27VC2.123−2.1526.398
11.300VC2.123−2.1526.398
17.200VC2.123−2.1526.398
14.500VC2.123−2.1526.398
9.700VC2.123−2.1526.398
17.200VC2.123−2.1526.398
14.100VC2.123−2.1526.398
14.100VC2.123−2.1526.398
16.300OJ2.123−2.1526.398
14.400OJ2.123−2.1526.398
31.600OJ2.123−2.1526.398
25.300OJ2.123−2.1526.398
17.600OJ2.123−2.1526.398
21.300OJ2.123−2.1526.398
17.400OJ2.123−2.1526.398
10.200OJ2.123−2.1526.398
38.500OJ2.123−2.1526.398
12.100OJ2.123−2.1526.398
5.400OJ2.123−2.1526.398
21.600OJ2.123−2.1526.398
20.700OJ2.123−2.1526.398
22.700OJ2.123−2.1526.398
22.200OJ2.123−2.1526.398
16.300OJ2.123−2.1526.398
27.200OJ2.123−2.1526.398
17.800OJ2.123−2.1526.398
20.300OJ2.123−2.1526.398
24.500OJ2.123−2.1526.398
32.900OJ2.123−2.1526.398
24.300OJ2.123−2.1526.398
4.400OJ2.123−2.1526.398
19.500OJ2.123−2.1526.398
29OJ2.123−2.1526.398
19OJ2.123−2.1526.398
22.500OJ2.123−2.1526.398
38.500OJ2.123−2.1526.398
26.400OJ2.123−2.1526.398
28.400OJ2.123−2.1526.398

Is your point that the groups overlap, or the size of the gap? Both are here, and each suggests a different title. Say which you mean. Then open the chart in Charts and read its How to read tab to see whether a reader would find it unaided.

04

Four edits that do most of the work

Read
  • Order categories by value, unless they have a natural order.
  • Label things directly, next to the line or bar, so nobody has to look back and forth to a legend.
  • Highlight one thing. Mute everything else to a quiet gray, and spend your color on the point.
  • Cut what carries nothing: heavy gridlines, repeated labels, and 3D.
Ranked barsWhich categories lead on a total, mean or median?
View data
productrevenue
Routers174.90
Cables15.420
Chargers25.680
Cameras634.51
Speakers134.27
Phones427.04
Chargers14.110
Cables20.470
Headphones367.94
Routers166.60
Cables10.800
Cables13.520
Printers291.17
Laptops1422.50
Watches364.38
Speakers163.27
Chargers39.510
Keyboards93.420
Phones709.95
Cables9.830
Cables38
Phones892.99
Cables14.540
Laptops1326.02
Printers286.51
Keyboards100.27
Chargers34.410
Monitors309.54
Cables16.720
Laptops1431.28
Cables17.480
Tablets572.75
Laptops1638.78
Phones1347.67
Drives101.94
Chargers28.160
Cables17.350
Chargers31
Drives117.61
Cables13.800
Chargers37.350
Cables13.810
Laptops1844.74
Cables10.840
Chargers41.680
Cables29.340
Headphones182.94
Headphones259.47
Phones1109.36
Chargers32.690
Phones771
Headphones289.72
Keyboards203.65
Printers348.41
Tablets568.91
Tablets621.64
Monitors307.55
Headphones128.50
Keyboards53.630
Monitors244.66

First 60 of 1500 rows.

Ranked bars in Charts comes sorted and labeled.

05

Show the data when you can

Explore

Summaries can hide a lot. These datasets have the same means, spreads and correlation, and they look nothing alike.

CExplorable · Same statistics, different pictures

How can datasets with identical summaries look nothing alike?

As the cloud morphs into this shape, what happens to Pearson's r?

How sure?

Target

1.00

Mean, SD and correlation are held fixed along the way.

Mean of xSD of yPearson rSpearman ρ
54.3026.90−0.060−0.029

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

With tens of points per group, a bar for each mean throws away most of what you know. Strip plot with mean ± CI or Raincloud in Charts keeps the points and still shows the summary.

Keep the bars for counts and totals, where the length is the quantity.

06

Send it to a report

In the app

Open Charts, choose a chart, and press Use my data to bind it to your columns. Then use Send to report or dashboard to add it to a report.

In the report, fill in Title with your sentence. Figures are numbered for you. Then read your report's preview: could someone who wasn't there say what the chart shows?

07

The note carries the fine print

Read

The title says what to see, and the Note field says how to read it. Put these there:

  • What any bars or bands show: SD, SE or a 95% CI.
  • How many observations each group has.
  • Anything excluded, and where the data come from.

Without the note, error bars can't be read at all, and a reader can't tell a sample of 12 from one of 12,000.

08

Do it in code

Explore

The Code tab in Charts writes your chart in matplotlib, plotly or ggplot2. Here are the edits by hand: a sentence for a title, the observations in gray, and the means labeled directly.

Python
import matplotlib.pyplot as plt
import pandas as pd

df = pd.read_csv("toothgrowth.csv")
fig, ax = plt.subplots()
for i, (name, g) in enumerate(df.groupby("supp")):
    ax.scatter([i] * len(g), g["len"], alpha=0.4, color="#888888")
    m = g["len"].mean()
    ax.hlines(m, i - 0.2, i + 0.2, color="#2a6fdb", linewidth=3)
    ax.text(i + 0.23, m, f"mean {m:.1f}", va="center")
ax.set_xticks([0, 1], ["Orange juice", "Ascorbic acid"])
ax.set_xlim(-0.5, 1.8)
ax.set_ylabel("Tooth length")
ax.set_title("Orange juice gave longer teeth on average, but the groups overlap", loc="left")
ax.spines[["top", "right"]].set_visible(False)
plt.show()
R
library(ggplot2)

df <- read.csv("toothgrowth.csv")
means <- aggregate(len ~ supp, df, mean)
ggplot(df, aes(supp, len)) +
  geom_point(color = "#888888", alpha = 0.4) +
  geom_crossbar(data = means, aes(ymin = len, ymax = len), width = 0.4, color = "#2a6fdb") +
  geom_text(data = means, aes(label = sprintf("mean %.1f", len)), nudge_x = 0.33) +
  scale_x_discrete(labels = c(OJ = "Orange juice", VC = "Ascorbic acid")) +
  labs(title = "Orange juice gave longer teeth on average, but the groups overlap", x = NULL, y = "Tooth length") +
  theme_minimal()
09

Check your understanding

Checkpoint

Check yourself

Which is an action title?

Show the answer

Answer: b

It states the finding, which a reader can then check against the chart. Use one only if the data support it, and if the venue allows it.

Check yourself

A line chart has five lines and a legend in the corner. What's the most useful edit?

Show the answer

Answer: a

Direct labels end the back-and-forth with a legend, and highlighting tells the reader where to look.

Check yourself

Where should "error bars show 95% confidence intervals; n = 30 per group" go?

Show the answer

Answer: b

Error bars look the same whatever they show, so the chart can't be read without this.

10

Your next chart

Reflect

Take a chart you're about to share and write its point as one sentence. Does the chart make that obvious? Which of the four edits would help the most?

11

Recap

Recap
  • A chart in a report has one job, so finish the sentence "This chart shows that…".
  • Use a title that says it if the venue allows, and make the four edits.
  • Show the data where you can, and put the fine print in the note.

Concepts in this lesson