Lecture 03Visual VariablesHow color, size and shape encode information — and how misusing them confuses the viewer instead of helping them.
Before
Now
TakeawayA color per bar that only repeats the bar's name adds noise — give color a job the eye can use at a glance: a group, a sign, a highlight.
TakeawayA categorical color key works only while it stays small — about 6 colors at most, so one look at the legend lasts for the whole chart.
TakeawayWith more than about 6 series, color alone can't identify them — group them, highlight the one that matters or label the lines directly.
TakeawayWhen a color already has a strong meaning for your audience, going against it costs the reader extra effort.
TakeawayA color that agrees with the reader's convention is understood for free — back it with position or labels, so the chart still works for viewers who can't see the hue.
TakeawayViewers carry a color's meaning from one chart to the next — reuse a color only when it means the same thing.
TakeawayNever encode a value in the radius — the eye reads a circle's size mostly from its area, so the area must be proportional to the value.
TakeawayEven honest area is hard to read precisely — people underestimate area ratios, so add a size key or labels whenever the reader needs actual numbers.
TakeawayShape can keep apart only a handful (about 5) of clearly different symbols — with more categories, merge them or split the chart into small multiples.
TakeawayPick shapes that differ in outline — curves, corners, points — not rotations of the same base form; color on top only speeds the reading up.
What this lecture covers: color, size and shape as encoding channels — which questions each one answers well, and the specific ways each one commonly gets misused.
What to notice & try
What to notice
Builds on Lecture 1: there position and length carried the values and color only told the series apart; here you see what color, size and shape can and can't carry on their own — Lecture 1 › Pie Chart (Show as bars) is the first card's ranking in action.
Most tabs come in pairs — the misuse first, then the fix on the same data: Too Many Colors → Recommended Count, Wrong Semantics → Correct Semantics, Misleading Size → Correct Size, Too Many Shapes → Appropriate Shapes. Judge the first chart before you open the second.
Every chart tab also has code to edit: its 'Try changing' block holds what the controls can't do — your own palette, a highlight, another marker.
Lecture 4 › Simulated Dashboard picks up where Correct Semantics stops: what red and green look like to colorblind viewers, and why a second, hue-free channel fixes it.
Try this
Open Too Many Lines and try to follow Headphones through the year — then switch Color by to Category: what gets easier, and what can you no longer see?
Open Same Color, Different Meaning and toggle 'Give Billing its own color' to see the false link disappear.
Open Misleading Size and guess how many times bigger the USA looks than Germany — then switch Size encoding to Area (correct).
Open Too Many Shapes and pick out the ▲ points, then find the triangles on Appropriate Shapes.
What does the color of a bar tell you that its name doesn't?Fourteen products, each bar in its own color, with the product's name under every bar.
What to notice & try
What to notice
Nothing — the names already say which bar is which, so the 14 colors only add noise and compete for attention with the one thing that matters, the bar length.
Colors that look alike suggest groups that don't exist: Headphones and Dairy get two oranges, Tablets and Sofas two almost identical purples, Shoes and Chairs magenta and violet — none of those pairs shares a category.
Try this
In the code, set HIGHLIGHT = ['Shoes'] and Run — one color, every other bar gray: now the color does a job the names can't, it points at the bar that matters.
In the code, try to make all 14 PRODUCT_COLORS clearly different from each other — how many can you pick before two start to look alike?
Switch to the Recommended Count tab — the same bars and names, with color encoding the category instead.
How many products fall into each category? Can you answer checking the legend only once?The same 14 bars with the same names, but color now encodes the product's category — four colors instead of fourteen.
What to notice & try
What to notice
Only 4 colors to remember — after one look at the legend you can count the bars: 5 Electronics, 4 Clothing, 3 Furniture, 2 Food.
The names still say which bar is which product; the color adds the one thing they don't — the category.
Try this
In the code, set SORT_BY_SALES = True and Run — the tallest bar comes first, the categories get mixed up and color is now the only thing that still shows which bars belong together.
Switch back to Too Many Colors and try to tell which products belong together there.
Open Too Many Lines to see what happens when there are no names to fall back on and color is the only key.
Find Headphones and Shoes. Which of the two sold more in July?Monthly sales of the same 14 products, one line each. Unlike the bars, the lines have no names under them, so color is the only way to tell which line is which.
What to notice & try
What to notice
The two purples are practically identical: Tablets' line climbs to 40 in December, Sofas' stays near 15 — from the colors alone, nothing says which is which.
Similar colors are easy to confuse while matching a line to the legend: Headphones' orange is close to Dairy's dark orange — pick the wrong line and Headphones seems to sell 22 in July instead of 10, which flips the answer.
Try this
Turn on Compare, then switch Color by to Category: the same 14 lines, and now each category's pattern stands out — Electronics jumps before Christmas, Clothing peaks in spring and autumn.
In Category mode, try to find Headphones again — grouping made the chart readable, but you can no longer tell the products apart.
In the code, set HIGHLIGHT = ['Headphones', 'Shoes'] and Run — two lines in color, the other 12 in light gray, names written at the line ends: the question above takes one glance and no legend.
Before reading the legend or the numbers: which months do the colors make look like good news?Monthly profit and loss of one company. Look at the bars before you read the legend.
What to notice & try
What to notice
Most readers' first association is green = positive and red = negative — traffic lights, error messages, warning signs. This chart uses red for profit and green for loss.
The bars' direction, the +/− labels and the legend are all correct — only the colors say the opposite, so the reader has to stop and work out which signal to trust.
The association is cultural, not universal: on Chinese and Korean stock charts, red means a rising price.
Try this
In the code, set PROFIT, LOSS = 'gray', 'gray' and Run: with no color at all, position and the +/− labels still say everything. Is that easier to read than the swapped pair? A color that fights the convention is worse than none.
Switch to the Correct Semantics tab — the same profit/loss data with the colors swapped.
Did your first guess about what the colors mean match the legend this time?The same profit and loss data as Wrong Semantics, with the two colors swapped.
What to notice & try
What to notice
Green for profit and red for loss agree with the first association, so nothing has to be corrected — the first glance and the legend say the same thing.
Red and green are the pair red-green colorblind viewers confuse. This chart still works for them because the sign is also shown by position, above or below zero, and by the +/− labels — see Lecture 4 (Color Blindness).
Try this
Switch back to Wrong Semantics and notice how much of the first reading you have to correct there.
In the code, set PROFIT, LOSS = 'blue', 'orange' and Run — the free green/red reading is gone, but red-green colorblind viewers now get a pair they can tell apart, and position and labels still carry the sign.
Chart A's revenue line and Chart B's Billing bar are the same blue. What does that suggest — and is it true?Two charts from the same page: monthly revenue, and support tickets by category.
What to notice & try
What to notice
The two charts are unrelated reports that happen to use the exact same blue. The eye assumes 'same color' means 'same thing', even across different charts, and goes looking for a link between revenue and billing that isn't there.
Apart from a few strong conventions (like red for loss), a color means only what its legend or labels say. Keep a color consistent when it IS the same thing across views; when it isn't, a color already in use nearby is taken.
Try this
Turn on 'Give Billing its own color' and notice how the false link between the two charts disappears — nothing else about the data changed.
In the code, set BILLING_FIXED = 'royalblue' and turn the checkbox on — technically a different color, but does the link come back? 'Its own color' has to look different, not just have another name.
How many times bigger does the USA bubble look, compared to Germany's?Country GDP as bubbles. The Size encoding control decides whether the value sets each bubble's radius or its area.
What to notice & try
What to notice
Radius encoding squares every ratio: the USA's GDP ($25.5T) is 6.2× Germany's ($4.1T), but its bubble gets about 39× the area — so the USA looks far more dominant than it is.
Nigeria's GDP is 1/51 of the USA's, so in radius mode its bubble gets 1/2600 of the area — look for it: there is a label and almost no bubble.
Try this
Turn on Compare, then switch Size encoding to Area (correct): the USA stays the same, and every smaller bubble grows to its true size relative to it.
Turn on Show GDP values to check your estimate against the real numbers.
In the code, set MARKER = 's' and Run in both encodings — squares whose width grows with GDP inflate the ratios exactly like circles: the mistake is the formula, not the shape.
The USA's GDP is 6.2× Germany's. Does its bubble look that much bigger — or less?The same bubbles with area proportional to GDP, plus a size key with three reference circles.
What to notice & try
What to notice
The encoding is now honest, but not precise: the USA's bubble has 6.2× Germany's area, yet to most people it looks less than 6× bigger.
That's what the size key is for — compare Germany's bubble with the $5T circle instead of estimating a ratio.
Try this
Estimate Japan's GDP from the size key alone, then turn on Show GDP values to check.
In the code, set KEY_VALUES = [0.5, 4, 25] and Run — reference circles that match Nigeria, Germany and the USA. Is a bubble easier to read when the key has a circle close to its size?
Switch to the Misleading Size tab with Size encoding on Radius (wrong) — the same data, with the small countries shrunk to almost nothing.
Find all the Species 3 points (▲). How sure are you that none of them is a ◀ or a ▶?Ten species, ten markers, one color — and the species are all mixed together, so the marker is the only clue.
What to notice & try
What to notice
Several markers are near-copies: four triangles that differ only in direction (▼ ▲ ◀ ▶), a diamond that is just a rotated square, and a pentagon and a hexagon that blur together at this size.
Compare how long it takes to find all the ★ (Species 10) with finding all the ▲ — a shape with an outline of its own is much quicker to find than a triangle that differs only in which way it points.
Nothing else gives the species away: they share one color, every marker covers the same area and all ten are spread over the same region — shape does all the work.
Try this
In the code, set COLOR_EACH_SPECIES = True and Run — 10 colors on top of 10 shapes. Is Species 3 easier to find now, or do you just have two crowded keys instead of one?
Switch to the Appropriate Shapes tab — the same 100 points in 4 groups, with 4 clearly different shapes.
Without color, can you find all the triangles? Is it easier than finding the ▲ on the previous tab?The same 100 points sorted into 4 groups, each with a shape of its own outline: circle, triangle, square, plus.
What to notice & try
What to notice
The four shapes differ in outline — round, three points, right-angled corners, arms — not just in rotation, so they can be told apart even when they're all mixed together.
Each group keeps the look of its species where it can: the ▲ ◀ ▶ species are now all triangles, the ■ and pentagon species squares.
Fewer categories means less detail: the 4 groups merge the 10 species, so this chart can no longer say which species a point is.
Try this
Turn on Redundant color: the groups pop out even faster. Turn it off again — shape alone still separates them, which is what keeps the chart readable in grayscale print or for colorblind viewers.
In the code, set MARKERS to {'Alpha': 'D', 'Beta': '^', 'Gamma': 's', 'Delta': 'v'} and Run with color off — a rotated square next to the square, an upside-down triangle next to the triangle. How fast can you find the ▲ now?
Ctrl+Enter to run
Error
No parameters for this demo.
No parameters for this demo.
No parameters for this demo.
Parameters
Color by
Grouping trades detail for readability: 4 colors are easy to follow, but they no longer say which line is which product.
No parameters for this demo.
No parameters for this demo.
Parameters
Swaps Chart B's 'Billing' bar to orange — same data, no more accidental link to Chart A's blue.
Parameters
Size encoding
Radius encoding squares every ratio; area encoding keeps it proportional.
Off by default — judge the bubbles first, then check with the numbers.
Parameters
Off by default — read the bubbles against the size key first, then check.
No parameters for this demo.
Parameters
Color on top of shape adds no new information — it makes the groups pop out faster for viewers who see color, while shape keeps working when color doesn't.
Click anywhere or press Esc to closeTap anywhere to close