How to Label Specific Points on a Scatter Plot (Mac & Windows)

142 countries, six worth naming. Pick where the text comes from, mark the rows that matter, and put each label where you want it.

Follow along: gapminder — 142 countries every five years, 1952–2007 (country, continent, year, lifeExp, pop, gdpPercap). Download the file — it's the same data as The Gap That Closed.
Requires Stratum 1.5, where the Labels control, row marking and label dragging arrive.

Most tools give a 142-point scatter two labeling options: every point named (unreadable) or none (annotate by hand elsewhere, redo it after every data change). What you want is these points, named from this column, placed where they read well, and still right after the next edit. In Stratum that's a few clicks.

Setup: the 2007 snapshot

Open the file, click Organize in the toolbar, and on the Filter tab set the action to Keep rows matching a rule year equals 2007 — 142 rows. Then Charts ▸ Relationship ▸ Scatter with X Columns = gdpPercap and Y Columns = lifeExp, and turn on Log Scale for X in the Chart Inspector's Axes tab.

1. Say where the text comes from: the Labels control

At the end of the scatter's column controls is Labels. Pick country. Labels come from columns you choose per chart — there is no hidden "label column" role silently deciding what a chart prints — and if you pick two, they join in pick order (Japan · Asia).

The same popover's Show labels on decides which points get drawn text:

  • Tooltip Only — nothing drawn; the label columns appear when you hover.
  • All Points — every point that has room. On 142 points, the crowded ones are left off rather than stacked.
  • Marked Rows — only the rows you've marked. This is the one you want.
  • Outliers and Line Ends — where the chart defines them: box-plot points beyond the fences, out-of-control points, regression residuals beyond ±3, the ends of each line. Marked rows are labeled under these too.
Stratum scatter of life expectancy against GDP per capita, log scale, with six marked countries ringed and labeled
Labels = country, Show labels on = Marked Rows: six countries named, 136 left quiet. Each marked point wears a ring, and the legend keys it.

2. Mark the rows you want named

Three ways, same result:

  • Shift-click a point to mark its row; shift-click again to unmark.
  • Shift-drag a rectangle to mark every point inside it. Add Option (Alt on Windows) to unmark them instead.
  • In the data sheet, select rows in the row gutter at the left edge and choose Data ▸ Rows ▸ Mark Rows. Right-clicking a point offers Mark Row too.

Mark the United States, China, India, Japan, Vietnam and South Africa. Each gets a ring and its name; the legend adds a Marked key, so an exported chart says what the ring means. A plain drag still zooms — marking only happens with Shift held.

The mark belongs to the row, not to this chart. Open Charts ▸ Distribution ▸ Box-Whisker with Parameters = lifeExp, Partition = continent and Overlays ▸ Data Points on, and the same six are ringed there; the data sheet tints them and puts a dot in the gutter. It follows the row through sorts and edits, undoes like any change, and is saved with the file.

3. Type a callout with Edit Label…

Sometimes the name isn't enough. Right-click South Africa and choose Edit Label…. A label is data, so the dialog asks where to store it: Stored in column: lists your text columns and New Column…. Choose New Column… (it creates a text column named Label), type 49 years at $9,300, and Save. The row is marked, the column joins the chart's labels, and the point now reads South Africa · 49 years at $9,300 — one step to undo. The same command is at Data ▸ Rows ▸ Edit Label… for rows selected in the sheet.

Your data stays put. The first time, the dialog opens on New Column…, not on the column the chart is labeled by. After that it opens on the column you last wrote to, here Label. country is still in the list if you really mean to rename a country.

4. Drag labels where you want them

Placement is automatic — beside the point, clear of other labels and marks, with a leader line when a label has to move further out; a marked row's label is placed first and never dropped. To choose yourself, press on a label and drag. It stays there, joined to its point by a leader, the other labels make room, and the move is one undo step saved with the chart.

Right-click a moved label (or its point) for Reset Label Position, or use Reset All Label Positions from the chart's menu to hand placement back to Stratum.

A dragged label on the Stratum scatter joined to its point by a leader line, with the right-click menu showing Reset Label Position
South Africa's callout dragged clear of the African cluster, held by a leader line. Reset Label Position puts it back.

5. In a gallery

Set Gallery = continent and the scatter fans into one panel per continent. The marked rows are labeled in whichever panel holds them, you can drag a label inside a panel, and the key above the grid reads Labels: country, Label.

Stratum scatter gallery by continent with marked countries labeled in their panels and a Labels key above the grid
Gallery by continent: each marked country is named in its own panel, and the key above the grid names the label column.

Why it works this way

Text always comes from columns picked on that chart, so the control bar shows what produced every label; which rows is a property of the rows, so the same six are named on every chart in the file. To go the other way — from an interesting point back to its record — see Find the Row Behind Any Point; to color points by group or by hand, see Partition vs Row Colors.

Download Stratum

Frequently asked questions

How do I label only some points on a scatter plot?

Pick a label column in the chart's Labels control and set Show labels on to Marked Rows. Then mark the rows you want named — shift-click a point, shift-drag across several, or select rows in the data sheet and choose Data ▸ Rows ▸ Mark Rows. Only those points get a drawn label; every point still shows its label columns on hover.

Can a label combine two columns?

Yes. Pick more than one column in the Labels control; they are joined in the order you picked them, separated by a middle dot — for example Japan · Asia.

What happens when labels overlap?

Every label goes through one placement routine: it sits beside its point where it covers no other label or mark, moves further out with a leader line when it has to, and an automatic label with nowhere to go is left off (hover still shows it). A marked row's label is placed first and is never left off.

Where does the text of a label I type with Edit Label… go?

Into a text column of your dataset — a label is data. The dialog's Stored in column: popup lists every text column you can type into plus New Column…, and saving also marks the row and adds that column to the chart's labels, as one undo step.

Does marking a row change my analysis?

No. A mark is a property of the row that charts draw as a ring and a label. It changes a result only if you ask it to — a filter rule using is marked, or a formula that calls marked().

Does this work the same on Windows?

Yes. The Labels control, marking, Edit Label…, label dragging and Reset Label Position are the same on Mac and Windows; where the Mac uses Option (to unmark with a drag) or Command-click, Windows uses Alt and Ctrl-click.

Related: How to Make a Scatter Plot → · The Gap That Closed →

scatter-plot labels workflows