Skip to main content
ExplainerData VisualizationMethodology Explainer· 5 min read· in Data & Analysis

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.

By Viktoria Sokolova

Data Visualizers 40%Statistical Traditionalists 30%Algorithmic Pragmatists 30%
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
13
Datasets in the Datasaurus Dozen
54.26
Identical mean of X across all sets
-0.06
Identical correlation coefficient
142
Observations per dataset

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]

Thirteen distinct datasets share identical summary statistics to two decimal places.

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]

Relying on these numbers alone, a machine learning model or a statistical summary would treat all 13 datasets as perfectly identical.

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]

Bandwidth selection determines whether KDE reveals or erases the true shape of the data.

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. The only robust approach is to plot the raw data points alongside the density estimation, testing multiple bandwidths to ensure the visual shape is a property of the data, not an artifact of the smoothing parameter.[4][7]

What we don’t know

  • There is no universally optimal bandwidth selection rule for Kernel Density Estimation that works across all possible data distributions.
  • It remains mathematically difficult to quantify the exact point at which a KDE transitions from capturing true multimodality to overfitting random noise.

Sources

Source coverage

7 outlets

3 viewpoints surfaced

Data Visualizers 40%Statistical Traditionalists 30%Algorithmic Pragmatists 30%
  1. [1]MediumData Visualizers

    The Datasaurus Dozen: Why Summary Statistics Are Not Enough

    Read on Medium
  2. [2]WikipediaStatistical Traditionalists

    Datasaurus dozen

    Read on Wikipedia
  3. [3]GeeksforGeeks

    Violin Plot vs Box Plot

    Read on GeeksforGeeks
  4. [4]DataCampAlgorithmic Pragmatists

    Kernel Density Estimation: From Theory to Practice

    Read on DataCamp
  5. [5]Andrey AkinshinAlgorithmic Pragmatists

    How bandwidth selection affects plot smoothness

    Read on Andrey Akinshin
  6. [6]Orange Data MiningData Visualizers

    Violin Plot

    Read on Orange Data Mining
  7. [7]Factlen Editorial TeamStatistical Traditionalists

    Synthesis by Factlen editorial team

    Read on Factlen Editorial Team

Comments

Stay informed

Every angle. Every day.

Get Data & Analysis stories with full source coverage and perspective breakdowns delivered to your inbox.