Visualizing Relationships
Single-variable plots reveal shape. Relationship plots reveal connection — how two or more variables move together, diverge, or interact.
Scatter Plots
Each observation becomes a point. Its x-position encodes one variable; its y-position encodes another. The resulting cloud reveals the relationship between two quantitative variables.
Reading a Scatter Plot
A scatter plot tells a four-part story about any relationship:
- Direction — positive, negative, or none?
- Form — linear, curved, or complex?
- Strength — tight cluster or diffuse cloud?
- Outliers — any points far from the main trend?
Correlation
Pearson’s r summarizes the strength and direction of a linear relationship in a single number from −1 to +1. Zero means no linear relationship; ±1 means a perfect line.
Pearson’s r
Pearson’s r is the average product of standardized x and y. When both deviate above their means together, the products are positive and r is positive.
Correlation ≠ Causation
Ice cream sales and drowning rates are strongly correlated — because both rise in summer. Correlation measures association, not cause. Always ask: could a third variable explain both?
Line Plots
When one axis is time, connecting the dots makes temporal order explicit. Line plots reveal trends, seasonal cycles, and sudden step changes that scatter plots would miss.
- Trends — sustained upward or downward movement
- Seasonality — regular repeating patterns
- Anomalies — sudden jumps or drops
Bubble Charts
Add a third variable by encoding it as bubble size. Hans Rosling’s famous country bubbles — x = income, y = life expectancy, size = population — told the story of global development in one chart.
Heatmaps
A heatmap encodes a matrix of values using color intensity. The most common use is the correlation matrix: each cell shows the correlation between two variables, revealing which pairs move together.
- Diagonal — always 1.0 (self-correlation)
- Warm colors — strong positive correlation
- Cool colors — strong negative correlation
Pair Plots
A pair plot creates a grid of scatter plots — every variable against every other. The diagonal shows each variable’s own distribution. One figure, every pairwise relationship.
Choosing the Right Chart
Match the chart to your data:
- Scatter plot — two continuous variables
- Line plot — one axis is time
- Bubble chart — three variables, few observations
- Heatmap — many variables or time × category
- Pair plot — explore all pairwise relationships at once
What you learned
Scatter plots, correlation, line plots, bubble charts, heatmaps, and pair plots form a complete toolkit for visualizing how variables relate. Correlation measures association — never forget it is not causation.