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. Many implementations embed a miniature box plot inside the violin to recover the quartile information.

Response time distribution by tier2026-W21 · 5 tiers · ms · KDE bandwidth · 0.4

Five tiers, five violins. The shapes carry information: a long-tailed tier shows a thin spike with a wide head; a bimodal tier shows two visible bulges; a tight distribution shows a narrow vertical band. The embedded box marks the quartiles for direct comparison.

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 mini-boxes 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

Embed a box plot inside the violin

A bare violin loses Tukey's quartile information. Hadley Wickham's ggplot convention places a thin box plot down the centre of each violin. 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: 0.4 in the subtitle is honest; a violin with no stated bandwidth is incomplete.

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.

Box, violin, raincloud — three answers to the distribution-comparison question
BOXVIOLINRAINCLOUD
The box compresses distribution to five numbers; the violin shows shape; the raincloud combines violin, box, and individual observations.

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 — area scales with count — is rarely what you want.

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).

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 ~12ms, database responses at ~80ms. A one-line annotation explains what the shape implies.

Anatomy

The Composition of a Violin Plot
UPPER MODE (DENSITY PEAK)LOWER MODEEMBEDDED BOX + MEDIANOUTLIERKERNEL DENSITY CURVE (MIRRORED)
An anatomical guide

The violin is structurally a mirrored density curve, optionally with a box plot embedded down its centre. The shape carries the distribution; the box recovers the quartile summary.

  • 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.