How Violin Plots Expose the Hidden Bimodality That Summary Statistics Erase
The Datasaurus Dozen proves that identical summary statistics can hide wildly different geometric distributions. Kernel Density Estimation solves this by visualizing the true shape of the data, but introduces a new vulnerability: bandwidth selection.
Share this story
In short
- The Datasaurus Dozen consists of 13 distinct datasets that share identical means, variances, and correlations to two decimal places.
- Summary statistics fail to describe data accurately when the underlying distribution violates the assumption of unimodality and symmetry.
- Violin plots use Kernel Density Estimation (KDE) to reveal multimodal peaks that traditional box plots hide.
The binding constraint for summary statistics—metrics like the mean, variance, and correlation coefficient—is that the underlying data must be unimodal and roughly symmetric. When that condition holds, a handful of numbers can perfectly describe a population's behavior. But when it fails, those exact same numbers become a mathematical illusion, hiding multimodal peaks, extreme skew, or clustered subgroups.
In modern data analysis, this constraint is routinely violated, making visualization the only reliable diagnostic tool to determine if the statistics are lying. Without a visual check, analysts risk building models on data that looks normal in a spreadsheet but behaves erratically in reality.[7]
The most famous proof of this failure originated in 1973 with statistician Francis Anscombe, who published Anscombe's Quartet to demonstrate how four wildly different datasets could share identical statistical properties. This lesson was updated for modern data science in 2016 when designer Alberto Cairo created a dataset of 142 observations.
Cairo's dataset possessed standard, unremarkable summary statistics, but when plotted on a scatterplot, the points formed the distinct shape of a Tyrannosaurus rex. Inspired by this visual trick, Autodesk researchers Justin Matejka and George Fitzmaurice published the 'Datasaurus Dozen' in 2017, taking the concept to its mathematical extreme.[1][2]
The Autodesk team used an optimization algorithm called simulated annealing to create 12 additional datasets that matched the dinosaur's metrics. As they wrote in their 2017 paper, 'new datasets are iteratively generated from a seed dataset through random perturbations of individual data points.'
The resulting 13 datasets share identical summary statistics to two decimal places: the mean of the x-variable is exactly 54.26, the mean of the y-variable is 47.83, and the correlation between them is −0.06. The linear regression coefficient of determination ($R^2$) is a flat 0.004 across the board, and the sample variance for x is locked at 16.76.[1][2]
Relying on these numbers alone, a machine learning model or a statistical summary would treat all 13 datasets as perfectly identical. Yet when plotted visually, one dataset forms a five-pointed star, another forms a bullseye, and a third forms parallel horizontal lines. The summary statistics erase the geometry of the data entirely. To solve this masking problem in one-dimensional continuous data, analysts increasingly rely on Kernel Density Estimation (KDE) and violin plots to visualize the true shape of a distribution before applying any predictive modeling.[1][2][4]
A traditional box plot only displays the five-number summary—the minimum, first quartile, median, third quartile, and maximum. Because it relies entirely on these summary metrics, a box plot cannot reveal if data is clustered into multiple peaks; a bimodal distribution looks exactly like a normal distribution with a wide variance.
Enter the violin plot. By mirroring a density curve on both sides of a central axis, it shows exactly where the values cluster. As researchers at Orange Data Mining explain, 'where the violin is fatter, there are more data points in the neighborhood. And where it is thinner, there are less.'[3][6]
The violin plot achieves this clarity by applying Kernel Density Estimation. KDE works by placing a smooth curve, known as a kernel function (typically a Gaussian bell curve), over every single data point and summing them up to create a continuous probability density function. Instead of slicing data into rigid, arbitrary bins like a traditional histogram, KDE provides a fluid estimate of where values are most concentrated. This mathematical smoothing easily exposes bimodal or multimodal distributions that would otherwise remain hidden inside a standard standard deviation metric.[3][4]
However, KDE introduces its own binding constraint: the bandwidth parameter, often denoted mathematically as $h$. The bandwidth controls the width of the individual kernel functions placed over each of the 142 data points. If the bandwidth is set too small, the resulting density plot is severely undersmoothed. It appears as a bumpy, noisy series of individual spikes that overfit the specific sample points, failing to generalize the broader trend and creating false peaks that do not actually exist in the wider population.[4][5]
Conversely, if the bandwidth is too large, the plot becomes oversmoothed, which is the most dangerous failure mode in exploratory data analysis. An oversmoothed KDE will merge distinct peaks together, forcing a bimodal distribution to look like a wide, smooth unimodal bell curve. In doing so, a poorly tuned KDE recreates the exact problem it was meant to solve: it hides the true shape of the data behind an algorithmic assumption, masking the very multimodality the analyst was trying to find.[5]
This creates a paradox in evidence-based data analysis. Summary statistics are perfectly objective but easily fooled by geometry, while KDE reveals geometry but relies on a subjective bandwidth parameter. While algorithms like Scott’s rule or Silverman’s rule attempt to automate bandwidth selection, the evidence demonstrates that neither summary statistics nor automated density plots can be trusted in isolation.
How we did this
- Method
- Comparison of the mathematical failure modes of summary statistics against the algorithmic failure modes of Kernel Density Estimation (KDE) smoothing.
- What we found
- While the Datasaurus Dozen proves that summary statistics erase geometric variance, applying KDE with an oversmoothed bandwidth recreates the exact same failure visually. An improperly tuned bandwidth forces distinct distributions to appear as identical unimodal curves, proving that visualization algorithms can mathematically hallucinate the same false consensus as basic averages.
- What we worked from
- Identical summary statistics across 13 datasets: Mean X=54.26, Mean Y=47.83 — Wikipedia
- Oversmoothed bandwidth merging distinct peaks: Unimodal appearance of multimodal data — Andrey Akinshin
- Limits of this analysis
- This analysis evaluates 2D scatter and density plots; in high-dimensional datasets, visualizing raw geometry becomes impossible, making the reliance on bandwidth-dependent dimensionality reduction even more precarious.
Key terms
- Kernel Density Estimation (KDE)
- A non-parametric method that places a smooth curve over each data point and sums them to estimate the probability density function.
- Bandwidth
- The smoothing parameter in KDE that determines how wide the curve over each individual data point should be.
- Multimodal Distribution
- A dataset that has multiple distinct peaks or concentrations of values, rather than a single bell curve.
- Simulated Annealing
- An optimization algorithm used to iteratively alter data points until they form a desired shape without changing their summary statistics.
Where opinion splits
Data Visualizers
Advocates for plotting raw data before applying any statistical models.
This camp argues that summary statistics are inherently reductive and dangerous when used in isolation. By pointing to Anscombe's Quartet and the Datasaurus Dozen, they demonstrate that algorithms cannot detect geometric anomalies like extreme outliers, clustering, or non-linear relationships. For visualizers, the first step of any rigorous data analysis must be plotting the raw points, as human optical recognition can instantly identify patterns that mathematical summaries erase.
Statistical Traditionalists
Emphasizes the necessity of non-parametric tests over subjective visual interpretation.
While acknowledging the value of visualization, traditional statisticians warn that relying entirely on plots introduces human bias and parameter sensitivity. They point out that Kernel Density Estimation is highly dependent on the chosen bandwidth, meaning an analyst can inadvertently 'tune' a visualization to show a desired result. Instead of relying on subjective charts, this camp advocates for robust non-parametric statistical tests that do not assume a normal distribution, ensuring that findings are mathematically provable rather than just visually suggestive.
Algorithmic Pragmatists
Focuses on automating bandwidth selection for large-scale data pipelines.
In modern machine learning and big data environments, manually inspecting scatterplots for millions of variables is impossible. This camp focuses on developing algorithmic rules—such as Scott's rule or Silverman's rule—to automatically select the optimal KDE bandwidth. They argue that while automated smoothing may occasionally overfit or underfit edge cases, standardizing the parameter selection is the only way to scale density estimation across massive, high-dimensional datasets where human visual inspection cannot reach.
- Data Visualizers
- Advocates for plotting raw data before applying any statistical models.
- Statistical Traditionalists
- Emphasizes the necessity of robust non-parametric tests over subjective visual interpretation.
- Algorithmic Pragmatists
- Focuses on automating bandwidth selection for large-scale data pipelines.
Perspectives this story doesn't cover
- Machine Learning Engineers
- High-Dimensional Data Analysts
Sources
[1]MediumData VisualizersThe Datasaurus Dozen: Why Summary Statistics Are Not Enough
Read on Medium →
[2]WikipediaStatistical TraditionalistsDatasaurus dozen
Read on Wikipedia →
[3]GeeksforGeeksViolin Plot vs Box Plot
Read on GeeksforGeeks →
[4]DataCampAlgorithmic PragmatistsKernel Density Estimation: From Theory to Practice
Read on DataCamp →
[5]Andrey AkinshinAlgorithmic PragmatistsHow bandwidth selection affects plot smoothness
Read on Andrey Akinshin →
[6]Orange Data MiningData VisualizersViolin Plot
Read on Orange Data Mining →
[7]Factlen Editorial TeamStatistical TraditionalistsSynthesis by Factlen editorial team
Read on Factlen Editorial Team →
More in Data & Analysis
See all →Data Visualization
The Square Root Transformation: Why Bubble Chart Radii Must Scale to the Square Root of the Data Value
7 sources
Data Visualization
Why Line Chart Aspect Ratios Distort Volatility and How Banking to 45 Degrees Works
7 sources
Data Visualization
Sankey Diagrams Use Proportional Link Widths to Track Mass and Energy Conservation
7 sources
Statistical Inference
Why Prediction Intervals Never Shrink to Zero While Confidence Intervals Do
6 sources
Comments
Every angle. Every day.
Get Data & Analysis stories with full source coverage and perspective breakdowns, free every day.




