Implementation:DistrictDataLabs Yellowbrick Anscombe Plot
| Knowledge Sources | |
|---|---|
| Domains | Visualization, Data_Science |
| Last Updated | 2026-02-08 05:00 GMT |
Overview
Concrete tool for rendering Anscombe's Quartet demonstration plot illustrating the importance of data visualization, provided by the Yellowbrick library.
Description
The anscombe module embeds four datasets from Anscombe's Quartet (1973). These datasets have nearly identical simple statistical properties (mean, variance, correlation, linear regression line) but produce dramatically different scatter plots. The function renders a 2x2 grid with scatter plots and linear best fit lines.
Usage
Import this function for teaching or demonstration contexts where you want to illustrate why summary statistics alone are insufficient and visualization is essential for understanding data.
Code Reference
Source Location
- Repository: DistrictDataLabs_Yellowbrick
- File: yellowbrick/anscombe.py
- Lines: 1-85
Signature
def anscombe():
"""
Creates 2x2 grid plot of 4 Anscombe's Quartet datasets.
Returns
-------
axa, axb, axc, axd : tuple of matplotlib.Axes
"""
Import
from yellowbrick.anscombe import anscombe
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | — | — | Function takes no arguments |
Outputs
| Name | Type | Description |
|---|---|---|
| axes | tuple of 4 Axes | The four matplotlib Axes objects (axa, axb, axc, axd) |
Usage Examples
from yellowbrick.anscombe import anscombe
import matplotlib.pyplot as plt
axes = anscombe()
plt.tight_layout()
plt.show()