Dataslope logoDataslope

Why Visualize Statistical Data?

What summary statistics hide and the human eye reveals — the case for turning numbers into pictures.

You can describe a dataset with a handful of numbers — a mean here, a standard deviation there, a correlation between two columns — and feel like you know it. Those summaries are genuinely useful. They are also famous for being liars.

A summary statistic is, by definition, a compression: it throws most of the data away and keeps one number. Two datasets that look nothing alike can be squeezed down to the same mean, the same spread, and the same correlation. If you only ever look at the numbers, you would swear they were identical. The moment you plot them, the illusion shatters.

This page is about that gap — between what statistics say and what the data is actually doing — and why a picture closes it. It is the reason the rest of this course exists.

The eye is a pattern detector

Before we touch any code, hold onto one idea. Your visual system is the most powerful pattern-recognition machine you will ever use. In a fraction of a second it picks out shape (is the relationship straight or curved?), clusters (are there separate groups?), trends (does y rise with x?), outliers (is one point flung far from the rest?), and gaps (is a region suspiciously empty?).

A table of summary numbers offers none of that. A mean tells you where the center sits, not whether the data is one tidy cloud or two clouds with a canyon between them. Standard deviation measures spread, not whether the spread is symmetric or skewed. Correlation measures linear association, and quietly ignores any pattern that is not a straight line.

So the case for statistical visualization is simple: plots restore the information that summaries compress away. Let's prove it.

Meet Anscombe's quartet

In 1973 the statistician Francis Anscombe built four small datasets to make exactly this point. Each has 11 (x, y) pairs. They are now a rite of passage, and they ship right inside Seaborn — sns.load_dataset("anscombe") returns all four stacked in a tidy table with three columns: dataset (the group label, "I" through "IV"), x, and y.

Let's start the way many people start with a new dataset: by computing summary statistics per group and reading the numbers off a table.

Code Block
Python 3.13.2

Read that table the way a busy analyst would. Every column is essentially constant across the four groups: each x averages 9.0, each y averages about 7.50, the standard deviations match to two decimals, and the correlation between x and y is about 0.82 every time. By every number here, the four datasets are the same dataset.

If summaries were the whole story, we would stop now and treat all four identically. That would be a mistake.

Why these particular numbers?

Anscombe reverse-engineered the four groups so their summaries would coincide. The shared correlation of ~0.82 even implies the same best-fit regression line — same slope, same intercept. The statistics are not approximately equal by luck; they were designed to be equal.

Now look at them

Here is the payoff. We hand the same table to Seaborn and ask for one panel per dataset. lmplot draws a scatter of the points and overlays the straight regression line that those identical statistics describe.

Code Block
Python 3.13.2

Four wildly different worlds — and the same red line slicing through each:

  • Dataset I is what the statistics led you to expect: a genuine, noisy linear relationship. The line is honest here.
  • Dataset II is a clean curve. There is a strong relationship, but it is not a straight line at all. A correlation of 0.82 and a straight fit badly misrepresent it.
  • Dataset III is a tight straight line except for one outlier that drags the fitted line off the true trend. Without the plot you would never suspect a single rogue point is steering your model.
  • Dataset IV is the most unsettling: x is constant for ten points, and a single far-right point — a high-leverage observation — invents an entire slope out of nothing. Remove that one point and the "relationship" evaporates.

Same mean, same spread, same correlation, same regression line — four completely different stories. That is the gap between numbers and reality, made visible in a single figure.

A correlation is not a shape

A correlation coefficient answers one narrow question: how close to a straight line is this? It says nothing about curves, clusters, or outliers. Datasets II, III, and IV all score ~0.82 while violating the spirit of that number entirely. Always plot before you trust a single statistic to summarize a relationship.

QuestionSelect one

All four Anscombe datasets share nearly the same mean, standard deviation, and correlation. What does plotting them reveal that those statistics hide?

That the datasets actually have different means once you look closely.

That the shape of each relationship is completely different — one linear, one curved, one outlier-driven, one leverage-driven.

That the correlation coefficient was computed incorrectly.

That three of the four datasets are too small to analyze.

Exploratory vs. explanatory visualization

It helps to name why you are drawing a chart, because the two main reasons pull in different directions.

Exploratory visualization is for you, while you still don't know what the data holds. You make many quick, rough plots — change a variable, add a color, switch chart types — hunting for structure and surprises. Speed and breadth matter more than polish. Anscombe's quartet is a parable about this phase: skip it and you ship conclusions built on a mirage.

Explanatory visualization is for an audience, once you have found something and want to communicate it clearly. Now you slow down: one careful chart, good labels, a deliberate color choice, everything in service of a single message.

Most of this course lives in the exploratory world — building the instinct to see structure — but the aesthetic skills we cover later (themes, palettes, annotations) are what carry a finding across the bridge into explanation.

The goal of statistical visualization

Boiled down to one sentence: the goal is to see structure — the shape, groups, trends, and anomalies that summary numbers average away. Keep asking the three questions from the introduction of every plot you make: what does it reveal, what does it hide, and when would it break?

It is not a fluke: the Datasaurus

If you suspect Anscombe rigged a rare special case, the Datasaurus dozen puts that to rest. It is a modern set of thirteen datasets — including one shaped, unmistakably, like a dinosaur — that all share the same means, the same standard deviations, and the same correlation to two decimal places. You can morph a blob of points into a star, an X, parallel lines, or the dinosaur while every summary statistic holds rock-steady.

The takeaway is not subtle: for any set of summary numbers there are endlessly many datasets that produce them. Summaries narrow the possibilities; only a picture pins down which one you actually have. (We don't load the Datasaurus here — Seaborn doesn't ship it — but it is worth a web search; the animations are unforgettable.)

Your turn

Let's make the "the numbers agree" half of the lesson concrete with your own hands. You'll compute the mean of y within each Anscombe group and confirm they really do collapse to the same value.

Challenge
Python 3.13.2
Confirm the four means agree

Anscombe's quartet hides four different shapes behind identical statistics. Prove the "identical" half yourself.

Using the anscombe dataset:

  1. Group by dataset and compute the mean of y for each group.
  2. Round each mean to 2 decimal places.
  3. Store the result in a variable named y_means (a pandas Series indexed by dataset label I-IV).

If the legend of Anscombe holds, all four values should round to 7.50.

Four groups, four identical means — and yet, as you saw above, four utterly different pictures. Holding both of those facts in your head at once is the whole point of this page.

Check your understanding

QuestionSelect one

Why is a summary statistic like the mean described as a "compression" of a dataset?

Because it makes the file smaller on disk.

Because it represents many data points with a single number, discarding the detail of how those points are arranged.

Because it always underestimates the true value.

Because it can only be computed on small datasets.

QuestionSelect one

Which task is a scatter plot of two numeric variables clearly better at than reading their correlation coefficient?

Reporting a single number you can paste into a sentence.

Revealing whether the relationship is straight, curved, clustered, or driven by an outlier.

Storing the relationship compactly for later computation.

Guaranteeing the relationship is causal.

QuestionSelect one

In Anscombe's Dataset III, ten points fall almost perfectly on a line and one point sits far off it. How does that single point affect a fitted straight-line regression?

It has no effect, because one point cannot change a line fitted to eleven.

It makes the correlation exactly 1.0.

It pulls the fitted line away from the trend the other ten points follow.

It splits the data into two separate clusters.

QuestionSelect one

What is the central lesson shared by Anscombe's quartet and the Datasaurus dozen?

Correlation always equals 0.82 for real datasets.

Larger datasets are always more trustworthy than smaller ones.

Many different datasets can share identical summary statistics, so you must visualize the data to know its true shape.

Standard deviation is a more reliable summary than the mean.

You have the founding motivation for everything ahead: numbers compress, pictures reveal. Next we look at how Seaborn thinks — the declarative, column-to-role mental model that lets you turn a tidy table into a revealing picture in a single line.

On this page