This entry is part of the Chart Index, the reference library for the Chart Design Field Guide.
The violin plot answers the box plot's biggest weakness: a box hides the shape of the distribution. Where Tukey's box reduces the data to five numbers, the violin replaces the box with a kernel density estimate — a smooth curve, mirrored around a central axis, that shows the full shape: bimodality, skew, asymmetric tails, sharp modes. The cost is that quartiles become less precise.
The form is most useful when distribution shape matters as much as central tendency. For a single distribution it can be overkill; for comparing many distributions where shape is the story, it is unrivalled.
What it is
A violin plot encodes a distribution as a mirrored kernel density curve. The density is computed once and reflected across a vertical (or horizontal) axis, producing a shape that bulges where observations cluster and narrows where they are sparse. Most implementations embed a slim summary inside the violin — a bar for the interquartile range and a dot at the median — to recover the quartile information the curve alone does not give.
The hero chart above shows four service tiers, thirty requests each. The shapes carry information the medians cannot: the Edge tier is a fat base near 12 ms with a long, thin tail of slow requests; Standard is a single hump; Compute has two distinct bulges — a cached path near 15 ms and a database path near 80 ms — with a pinched waist between; Legacy is a broad spindle that stretches past 120 ms. Randomise the observations and the densities are recomputed from the raw values, so the bimodal tier stays bimodal.
When to use it
Violin plots are the right choice when:
- You are comparing distributions across groups and shape matters — bimodality, skew, sharp modes.
- You have enough observations per group for a kernel density estimate to be meaningful (typically ≥100).
- The reader's question is "what are these distributions actually shaped like?"
- You need richer information than a box plot without the bin-width fragility of a histogram.
- The data is continuous — violins on integer data with few values produce misleading curves.
When not to use it
- Small samples. Below 50 observations per group, the kernel density curve is fiction. Use a strip plot or bee swarm.
- Unfamiliar audiences. Violins read as decoration to readers who do not know the form. For business audiences, a box plot or strip is safer.
- Need for precise quartiles. Embedded summaries help, but the violin is fundamentally a shape chart, not a quartile chart.
- One distribution. A single violin floating in space is rare; a histogram or density plot reads better.
Design principles
Use the violin where the box would lie
The box plot's compression is silent: two distributions with the same quartiles draw the same box. The violin is the form that makes that difference visible.
Embed a summary inside the violin
A bare violin loses Tukey's quartile information. Hadley Wickham's ggplot2 convention places a thin box plot down the centre of each violin; the renderer used here draws a slim interquartile bar with a hollow dot at the median. The combined form gives shape and summary; the eye reads either depending on the question.
Choose bandwidth deliberately
Most violin implementations default to Silverman's rule of thumb. For long-tailed distributions, that rule oversmoothes. For multimodal distributions, it can hide modes. Pick a bandwidth by experiment and state it. Bandwidth: 6 ms in the subtitle is honest; a violin with no stated bandwidth is incomplete. The two figures below draw the hero's Compute tier at the extremes.
Do not smooth a handful of points
A kernel density estimate of eight observations looks exactly as confident as one of eight hundred. The violin's smoothness reads as certainty, and with a small sample that certainty is invented.
Mirror or one-side, deliberately
Standard violins are mirrored. Half-violins — showing only one side — are useful when paired with another visualisation (raw points, box plot) on the unused side. The hybrid is sometimes called a raincloud plot.
Keep widths consistent
If you scale violin width by group size (n), the chart encodes two variables — distribution shape and count — without telling the reader. Either fix the widths and annotate the n separately, or document the area-encodes-count convention explicitly. The default in most tools — every violin scaled to the same maximum width — is the one to keep.
Use a single hue family
Like all multi-distribution displays, violins benefit from quiet, consistent colour. A single accent hue across all violins, or a soft sequential ramp keyed to an ordinal dimension (e.g. tier), lets the shapes do the talking; a categorical rainbow asks the reader to decode colour before they can read the curves.
Avoid overlapping violins
Violins do not overlay cleanly. Two semi-transparent violins on top of each other become a third shape that neither distribution would predict. For comparison, place them side by side or use a different form entirely.
Annotate the modes
If a violin shows two clear modes, point them out. Bimodal: cached responses cluster at ~15 ms, database responses at ~80 ms. A one-line annotation explains what the shape implies.
Anatomy
The violin is structurally a mirrored density curve with a slim quartile summary embedded down its centre. The shape carries the distribution; the bar and dot recover the five-number summary the box plot would have given.
Related types
- Box plot — the form the violin extends. More compact, easier to read precisely, hides shape.
- Density plot — a single distribution's smoothed curve. The violin's basis, without mirroring.
- Strip / jitter plot — every point shown. Useful for small samples and as the raincloud companion.
- Bee swarm — strip plot with collision avoidance; another shape-preserving alternative.
- Histogram — the unsmoothed alternative. Honest about its bins.
Reading list
- Hintze, J. & Nelson, R. (1998). Violin Plots: A Box Plot–Density Trace Synergism. The form's introduction.
- Wickham, H. (2010). A Layered Grammar of Graphics. Embedded box plots in ggplot2.
- Allen, M. et al. (2019). Raincloud Plots: A Multi-Platform Tool for Robust Data Visualisation. The raincloud variant.