01

Chapter 1 · Foundations

Introduction to Visualization

A chart is not decoration placed on top of analysis. It is the delivery mechanism for the analysis. Everything in Chapter 1 follows from that.

1Why visualization exists at all

Start from how a person takes in information, because every other rule in the course sits downstream of it.

Visual learners

about 65%

of people learn better from a picture than from the same fact in words.

Retention

80% vs 20%

seen against read. Reading twice still loses detail later; seeing once holds.

Processing time

13 ms

to understand an image. Text has to be decoded first, then held, then recalled.

Two consequences worth stating plainly. Text forces the reader to decode, hold in memory, then recall, and a visual skips the decode step. So the chart is the communication, not an illustration of it.

What a visualization actually is

Underneath every chart there is one operation: a number is encoded as a visual property, and the eye reads the property back out. Choosing a chart is really choosing which property will carry your number.

Fig 1.1One dataset, five encodings. Try to rank the five regions each time
encode value as

The five values are identical in every view. Position and length let you put the regions in order and say roughly by how much. Angle is harder. Area and colour let you spot the largest and stop there. Chapter 4 turns this into a ranking you can quote; this is what that ranking feels like from the reader's side.

Why statistics alone are not enough

Anscombe's quartet. Four datasets with the same mean of x, same mean of y, same variance and the same regression line. Judged on the summary table you would call them the same phenomenon.

Fig 1.2Four datasets that share every summary statistic
Datasetmean xmean yvar xvar ycorrelationWhat it actually is
Every number in the table agrees to two decimals. The pictures do not agree at all. A table cannot tell you it is describing a curve, and it cannot warn you that one extreme point is steering the whole result. This is the formal argument for plotting during exploration, not just describing.

Gestalt principles: how the eye groups things

These are not design rules somebody invented. They are observed facts about human perception, which is why they work on every audience.

Fig 1.3Six principles, each switched on and off
Switch the principle off and the same marks carry no grouping. Switch it on and the grouping appears without anyone being told about it. You already use these by instinct; naming them is what lets you place attention deliberately instead of hoping.

Data types decide chart types

Before any chart, classify the variable. Everything downstream depends on this.

TypeTest for itExample
Categorical / nominalGroups with no orderGender, race
BinaryExactly two, mutually exclusiveBought or not
OrdinalRanked, gaps not meaningfulRating 1 to 5
ContinuousFractions make senseRevenue, GDP
DiscreteFractions do not make senseNumber of cars
  1. Structured data can be computed on immediately, so it is easier to visualise.
  2. Unstructured data must be read by a human before any variable exists, so it needs processing first.
  3. Binary is a special case of categorical, called out separately because it represents something happening or not.

The seven stages of data visualization

The process from raw file to finished visual. Taught in order, but it is a loop, and the loops are the part that matters. Anybody can list seven words.

Fig 1.4The pipeline, and where it runs backwards
what just happened

Represent gives a rough, honest, useless chart. Refine turns it into one that answers the question, and the gap between the two is usually just ordering the bars and adding a reference line. Automated tools hide these stages rather than removing them.

Choosing a chart from your message

Chart choice starts from what you want to say, not from what data you happen to have.

Fig 1.5Four message families, with the chart each one asks for
my message is
The same underlying sales table drives all four panels. Changing the question changes the chart, and nothing about the data changed. Comparison, distribution, composition, relationship is the list to be able to write out with the charts under each.

Boxplot anatomy

The single most useful diagram in this chapter. Start from the idea, not the picture: sort your values, then cut the sorted list into four equal groups. The three cut points are the quartiles, and the distance from Q1 to Q3 is the interquartile range, the middle 50% of the data.

Fig 1.6Build the boxplot one step at a time
step data
The point people miss: a whisker ends at a data point, not at the fence. On the worked example the upper fence is 22.5, but the whisker stops at 14, because 14 is the largest actual value below it. The fence is an invisible cut-off used only to decide what counts as an outlier.
Drawing one from scratch
  1. Sort the values and mark the median.
  2. Find Q1 and Q3, then draw the box between them.
  3. Compute IQR = Q3 − Q1, then 1.5 × IQR.
  4. Set fences at Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Draw whiskers to the furthest real value inside each fence.
  5. Plot anything beyond a fence as a separate dot.

Reading the shape

The value of the boxplot is that position tells you about skew with no calculation. Real data is rarely symmetric, so an off-centre median is the normal case rather than an error.

Fig 1.7Why a boxplot beats a histogram for outliers
Add the extreme values and the histogram gains four bars one pixel tall, which the eye slides straight over. The boxplot draws them as separate dots that cannot be missed. Read both together: histogram for shape, boxplot for outliers and skew.

The distribution ladder

Each step shows more of the raw data than the one before. Use the simplest one that shows your finding, since more detail is not automatically better.

Fig 1.8Histogram → boxplot → boxen → swarm, on one dataset

The 240 values never change. What changes is how much of them the chart is willing to show, and what it hides in exchange for being readable. The histogram depends entirely on the bin choice; the swarm has no binning at all and no summary either.

Looking at several variables

Absolute counts against proportions

Fig 1.9The same two branches, counted and then normalised

A stacked bar in absolute numbers is dominated by whichever branch is larger, and North looks like the problem because it handles more customers. Convert to a 100% stacked bar and the conclusion reverses. Absolute counts answer "how many", proportions answer "what rate", and they are different questions.

Relationship, and the trap

Always describe a scatter in three separate parts: direction (positive, negative, none), shape (linear, exponential, parabolic, u-shaped) and strength (strong, weak, none).

Correlation is not causation

Called out in the course as the most common analyst error. Correlation states a direction only. It never establishes that one variable produces the other, and if a correlation has no sensible business or theoretical explanation, assume a hidden variable is driving both.

Fig 1.10A confounder, and what happens when you hold it still
Across all 300 days the two series track each other closely. Narrow the view to days at one temperature and the relationship disappears, because temperature was producing both. Isolate the confounding variable and the original correlation usually weakens or vanishes. That is the test to apply before claiming a cause.

The multivariate toolkit

ChartWhat it adds beyond a scatter
Joint plotDistributions of x and y drawn on the axes, so you can check the relationship holds across the whole range
Pair plotEvery variable against every other, coloured by outcome
Heat mapCorrelation matrix as colour. The diagonal is always 1
Parallel coordinatesThree or four variables side by side. Every axis must be rescaled to be comparable first
Dual axis chartTwo variables with different scales, one axis on each side
Fig 1.11A correlation matrix as a heat map
Correlation runs from −1 to +1 and one direction is given the strong colour. The diagonal is always 1 because every variable correlates perfectly with itself, which is why it carries no information and is often blanked out. Hover any cell for the value the colour is standing in for, which is the hover tooltip doing exactly the job Chapter 4 says colour cannot do.

Exploratory against explanatory

The same chart can be either. What changes is what you are doing with it.

Fig 1.12One chart, moved from exploration to argument
Nothing was added to the data between these two states. Sorting, one strong colour and a note are what turn a chart that shows data into one that argues a point. Plot the data and stop at understanding and it was exploration. Carry on and argue a point and it became explanation.
ExploratoryExplanatory
PurposeUnderstand the dataConvince an audience
ModeAskingTelling
AudienceYourselfSomeone else
Stages it maps toParse, filter, mineRepresent, refine, interact
OutputMany rough chartsOne deliberate chart

Context

Named as the single most important thing to settle before designing any visual. One dataset does not have one correct chart. It has one correct chart per audience, because the audience decides what question is being asked.

The four questions
  1. Who am I speaking to, and what is their background?
  2. What are they looking for from this?
  3. Do I have enough data to give them that?
  4. How much space and time do I have?
What context is not

Context is not observable on the chart. It is the reasoning that produced the chart. It sharpens as you work, so an early rough version is fine, but it must exist before you draw. Audience biases and likely objections belong in it too.

Mistakes to avoid

  1. Too much on one chart creates clutter and the audience stops looking for the insight.
  2. Use several visuals rather than forcing every data point into one.
  3. Always label both axes and give the chart a header.
  4. Scale both axes to suit the data, since bad scaling distorts the pattern and produces wrong conclusions.

Key points

  1. Three perception facts: 65% visual learners, 80% against 20% retention, 13 ms to process an image.
  2. Three uses of visualization: decisions, patterns and trends, presenting an argument.
  3. Six Gestalt principles by name with one use each.
  4. What Anscombe's quartet proves, and why summary statistics mislead.
  5. Five data types, and structured against unstructured.
  6. Seven stages in order, plus at least three backward loops and their triggers.
  7. Four chart families, with the question each answers.
  8. Boxplot anatomy: quartiles, median, whiskers at 1.5 × IQR, outliers beyond.
  9. The distribution ladder: histogram, boxplot, boxen, swarm, and what each adds.
  10. Absolute against 100% stacked bar, and why the conclusion can reverse.
  11. Correlation is not causation, and what a confounding variable does.
  12. Exploratory against explanatory, and that one chart can serve both.
  13. Context: one dataset, one correct chart per audience.