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.
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.1 or later, which adds linked selection to the Labels control, row marking and label dragging from 1.5.
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.
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
Select first, then mark. Selecting works the way it does in JMP:
- Click a point to select its row. Shift-click adds more, and ⌘-click (Ctrl-click on Windows) adds or removes one.
- Drag a rectangle to select every point inside it.
- Or select rows in the data sheet's row gutter, at the left edge.
There is one selection per file: the same rows light up in the data sheet and on every chart, and the rest dim. Then choose Mark Selected Rows, from the right-click menu on a selected point, from Data ▸ Rows, or with ⌃⌘M (Ctrl+M on Windows). Unmark Selected Rows takes them back out.
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. If the chart's Zoom is on, a plain drag zooms instead; hold Shift to draw the selection rectangle. Clicking empty space clears the selection, but marks stay.
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.
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.
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.
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.
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 select the points you want named (click one, Shift-click to add more, or drag a rectangle around several) and choose Mark Selected Rows from the right-click menu or Data ▸ 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 Command-click and Control-Command-M, Windows uses Ctrl-click and Ctrl+M.
Related: How to Make a Scatter Plot → · The Gap That Closed →