A scatter plot spends both of its spatial axes on two variables. To show a third, fourth, or fifth, you have to map them onto weaker channels, or split the picture into panels. The art is spending your strongest channel on what matters most.
Spending Your Channels Wisely
Recall the perception hierarchy from the Charts for Categorical Data chapter: we read position most accurately, then length, with color, area, and shape near the bottom. So put your two most important variables on the axes, and demote the rest:
Position (x, y)
The strongest channel. Spend it on your two key variables.
Color hue
Good for a category, but only about 6 to 8 stay distinguishable.
Size (area)
A third quantitative variable, read roughly. Size by area, never radius.
Faceting
Repeat one chart per category. Reuses the strong position channel in every panel.
Past three or four encodings a single chart becomes a decoding puzzle. When in doubt, prefer small multiples over piling color plus size plus shape onto one busy scatter.
The Heat Map
A heat map is a grid whose cells are colored by value. Its most common data-science use is the correlation matrix: every pair of numeric variables, colored on a diverging scale centered at zero, since +1 and −1 mean opposite things.
Use a sequential palette for one-directional magnitude (counts, sales) and a diverging one when there is a meaningful midpoint (correlation around 0, change versus a baseline). Avoid rainbow / jet: it is perceptually non-uniform, invents false bands, and fails in grayscale and for colorblind readers. Reach for perceptually uniform maps like viridis.
It shows association, not causation, and it measures only linear correlation, so a strong curved relationship can read near zero (remember Anscombe). Always pair it with the scatterplots.
Scatterplot Matrix & Lorenz Curve
The scatterplot matrix (or pairplot) is the heat map's companion in early analysis: a grid of every pairwise scatter, with each variable's distribution down the diagonal. Color the points by a category to see whether groups separate.
What it is for
Scan all pairwise relationships and all distributions in one figure during EDA.
Its limit
It grows as variables squared, so keep it to a handful, and it shows only pairwise, not three-way, structure.
The Lorenz curve is a specialized visual with a number attached. Sort a population poorest to richest, then plot cumulative share of people against cumulative share of income. The diagonal is perfect equality; the more the curve sags below it, the more unequal the distribution.
The Gini coefficient turns the gap into one number: A / (A + B), the area between the equality line and the Lorenz curve over the whole triangle. Since the triangle is 0.5, Gini = 2A, running from 0 (perfect equality) to 1 (one person has everything). Real income Ginis run from about 0.24 (Slovakia) to 0.63 (South Africa). State whether you mean income or wealth, before or after tax, they differ a lot.
Dashboards & Other Specialized Charts
A dashboard is the most important information for a goal, arranged on a single screen so it can be read at a glance (Stephen Few's definition). Those three parts, most important, single screen, at a glance, drive every design choice.
Fit it on one screen (no scrolling), put the headline metrics top-left where eyes land first, group related views, and keep color muted so an alert can actually stand out. Skip the decorative gauges and 3D, they spend a lot of ink on one number. Distinguish an operational dashboard (monitor now) from an analytical one (explore and drill down).
A few more specialized charts, each with a catch:
| Chart | Good for | Watch out |
|---|---|---|
| Parallel coordinates | Many dimensions at once; spotting clusters | Only adjacent axes compare; ordering changes the story |
| Bubble chart | A 3rd (size) and 4th (color) variable on a scatter | Size by area, not radius, or large values explode |
| Radar / spider | A profile across a few metrics | Area distorts with axis order; usually a bar beats it |
| 3D plot | Genuinely spatial or surface data | Occlusion and perspective distort; prefer 2D + color/facet |
| Choropleth map | A value across geographic regions | Big regions dominate; use rates per capita, not raw counts |
The correlation heat map (df.corr()) and the pairplot are usually the first two cells of a
multivariate analysis: they reveal redundant features, candidate predictors, clusters, and outliers
before any modeling. Dashboards are how those findings become something stakeholders watch over time.
Multivariate Views in Machine Learning & AI
Machine learning is mostly about relationships between variables, so the multivariate charts here are the everyday tools of feature analysis, not just presentation graphics.
| Multivariate view | Where it shows up in ML | What it tells you |
|---|---|---|
| Correlation heatmap | Screening features before modeling | Highly correlated pairs signal multicollinearity and redundant features to prune |
| Scatter / pair plot | The standard first-pass EDA on a numeric dataset | Linear vs non-linear relationships, clusters, and outliers, all at a glance |
| 2-D projection | A scatter of the first two PCA or t-SNE components | How separable the classes are, and whether the data has natural groups |
When two features correlate strongly (weight and horsepower here, at about 0.83), keeping both can destabilize a linear model and add little. The correlation heatmap is where you spot those pairs, the visual front end to feature selection and dimensionality reduction.
Real-World Example: Car Specifications
Cars are a natural multivariate dataset, weight, power, economy, and price all move together. On these 250 vehicles, a scatter of weight against fuel economy shows a strong negative relationship (heavier cars use more fuel, correlation about −0.85), and a correlation heatmap lays out every pairwise link at once. The companion notebook draws the scatter, the heatmap, and a bubble chart sized by price.
One row per vehicle: car_id, weight_kg,
horsepower, mpg, price_usd, and origin (USA, Europe, Japan).
The four numeric columns are related, so they are ideal for scatter plots, a correlation heatmap, and a bubble
chart, while origin maps to color.
Bring it to life in Python
The companion notebook builds an annotated correlation heat map with a diverging scale, a scatterplot matrix colored by category, a Lorenz curve with its Gini computed two ways, an honest small-multiples panel, and a bubble chart contrasting area versus radius sizing.
View opens the rendered notebook instantly (no setup). Open in Colab runs &
edits it live in your browser. To run locally, install numpy, pandas,
scikit-learn, matplotlib and launch jupyter notebook.
🎓 Key Takeaways
- ✓Spend position on your key variables; demote others to color, size, or facets, and prefer small multiples over overloading one chart.
- ✓Heat maps use sequential or diverging palettes (never rainbow); a correlation heat map shows linear association, not cause.
- ✓The scatterplot matrix scans all pairwise relationships at once, for a handful of variables.
- ✓The Lorenz curve visualizes inequality; Gini = 2A runs from 0 (equal) to 1 (one owns all).
- ✓Dashboards put the key metrics on one screen, top-left, glanceable, with muted color and no chartjunk.
Practice Challenges
Five short challenges, beginner to intermediate. Try them on paper or in Python before checking the solutions.
Read a heat map
Build a correlation heat map for four variables where two are nearly identical. Identify the redundant pair, and explain why a heat map cannot prove causation.
df.corr() + a diverging colormap; association is not cause.Read a SPLOM
Make a scatterplot matrix of three numeric variables colored by a two-class label. Which pair best separates the classes, and what does the diagonal show?
pd.plotting.scatter_matrix with a color array; diagonal = distributions.Compute a Gini
For incomes [10, 20, 30, 40, 100], plot the Lorenz curve with the line of equality and
compute the Gini coefficient.
Pick the colormap
Name the right colormap family for each: (a) a correlation matrix from −1 to 1; (b) monthly rainfall totals; (c) percent change from last year. Why avoid rainbow/jet?
Area, not radius
On a bubble chart, one value is 4× another. How should the bubble radius compare, and what goes wrong if you set radius proportional to the value instead?
A fully-worked solutions notebook walks through all five challenges in the same visual style. Try them yourself first, then compare.
Quiz: Test Yourself
Eight quick questions on multivariate visuals. Answer them, hit Check Answers, and keep refining until you score 100%. Your progress is saved, so you can hop back to the chapter and return anytime.