Data Visualization › Scatter Plots: Revealing Relationships

Michael BrenndoerferMay 25, 20255 min read
Machine Learning from ScratchAll chapters
Part 1 of 9Statistics 101
Chapter 8Data Visualization › Scatter Plots: Revealing Relationships
Reading section 5 of 10 · Scatter Plots: Revealing Relationships · 5 minSection 5 of 10 · 5 min

Book contents

Section 5 of 10 · 5 min read

Data Visualization › Scatter Plots: Revealing RelationshipsOne section · Sections in this chapter5 / 10 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Scatter plots display the relationship between two continuous variables by plotting each observation as a point in two-dimensional space. The resulting point cloud reveals patterns of association that summary statistics like correlation coefficients capture only partially. A tight linear arrangement of points indicates a strong relationship, while a diffuse cloud suggests weak or no association. Non-linear patterns (curves, clusters, or fan shapes) expose complexities that linear models would fail to capture.

The strength of scatter plots lies in their ability to reveal the nature of relationships, not just their existence. Two variables might have identical correlation coefficients but completely different scatter plot patterns. One might show a linear relationship, while another exhibits a curved relationship, and a third displays a linear trend distorted by a few influential outliers. Only the scatter plot distinguishes between these scenarios, guiding the choice of appropriate modeling techniques.

Out[4]:
Visualization
Scatter plot showing strong positive linear relationship.
Strong positive linear relationship where x and y increase together in a tight, consistent pattern. The correlation coefficient is approximately 0.95, and a simple linear regression would provide excellent predictions. This pattern might represent relationships like advertising spending versus sales, or study hours versus test scores.
Scatter plot showing weak relationship with scattered points.
Weak relationship with widely scattered points showing little consistent pattern. The correlation coefficient is near zero, indicating that knowing x provides minimal information about y. Such scatter plots suggest that the two variables are largely independent, or that their relationship is too complex or noisy to be captured by simple linear association.
Scatter plot showing non-linear quadratic relationship.
Clear non-linear (quadratic) relationship where y increases with x but at an accelerating rate. The parabolic curve cannot be adequately captured by linear correlation, which might be near zero despite the obvious relationship. This pattern demonstrates why visual inspection is essential: relying solely on correlation coefficients would miss this important structure.

Scatter plots also expose violations of statistical assumptions that can undermine formal analyses. Heteroscedasticity, where the spread of points increases or decreases along the range of the predictor, violates an important assumption of ordinary least squares regression. A funnel-shaped scatter plot immediately reveals this problem, suggesting the need for robust regression methods or transformation of variables. Clusters of points separated by gaps might indicate distinct subgroups that should be modeled with categorical variables or mixture models rather than treating all observations as homogeneous.

Out[5]:
Visualization
Scatter plot showing outliers deviating from linear trend.
Scatter plot with several obvious outliers (highlighted in red) that deviate substantially from the main linear trend. These outliers could represent data entry errors, unusual observations from a different population, or genuinely extreme cases that warrant investigation. Their presence would inflate error metrics and potentially distort regression coefficients if not addressed.
Scatter plot showing heteroscedasticity with funnel shape.
Scatter plot exhibiting heteroscedasticity, where the spread of y values increases as x increases, creating a characteristic funnel shape. The variance is small for low x values but grows progressively larger for high x values. This pattern violates the constant variance assumption of ordinary least squares regression, suggesting the need for weighted regression, robust methods, or transformation of variables.

For datasets with many observations, overplotting can obscure patterns as thousands of points overlap and create solid blocks of color. Transparency settings (alpha blending) partially address this by allowing dense regions to appear darker while preserving visibility of individual points in sparse areas. Hexagonal binning or contour plots provide alternative representations that summarize point density when datasets grow too large for individual points to remain distinguishable.