Distribution
Violin Plot
Combines box plot with kernel density to show full distribution shape.
Response Distribution by Treatment
Clinical trial results
View data (60 rows)
| Group | Value |
|---|---|
| Control | 42 |
| Control | 44 |
| Control | 46 |
| Control | 47 |
| Control | 48 |
| Control | 48 |
| Control | 49 |
| Control | 50 |
| Control | 50 |
| Control | 51 |
| Control | 52 |
| Control | 52 |
| Control | 53 |
| Control | 54 |
| Control | 55 |
| Control | 47 |
| Control | 49 |
| Control | 51 |
| Control | 53 |
| Control | 46 |
| Treatment A | 56 |
| Treatment A | 58 |
| Treatment A | 60 |
| Treatment A | 61 |
| Treatment A | 63 |
| Treatment A | 63 |
| Treatment A | 64 |
| Treatment A | 65 |
| Treatment A | 66 |
| Treatment A | 67 |
| Treatment A | 68 |
| Treatment A | 69 |
| Treatment A | 70 |
| Treatment A | 72 |
| Treatment A | 75 |
| Treatment A | 62 |
| Treatment A | 64 |
| Treatment A | 66 |
| Treatment A | 68 |
| Treatment A | 61 |
| Treatment B | 68 |
| Treatment B | 71 |
| Treatment B | 74 |
| Treatment B | 76 |
| Treatment B | 78 |
| Treatment B | 79 |
| Treatment B | 80 |
| Treatment B | 81 |
| Treatment B | 82 |
| Treatment B | 83 |
| Treatment B | 85 |
| Treatment B | 86 |
| Treatment B | 88 |
| Treatment B | 90 |
| Treatment B | 93 |
| Treatment B | 77 |
| Treatment B | 80 |
| Treatment B | 83 |
| Treatment B | 85 |
| Treatment B | 75 |
Use a violin plot when…
- Comparing distribution shapes across groups
- Revealing bimodal distributions
- Showing skew or asymmetry that a box plot would hide
Avoid when…
- Small samples (rule of thumb: n<20 per group makes the KDE unreliable)
- When audience is unfamiliar with the form
Data it needs
| Property | Value |
|---|---|
| Min Rows | 10 |
| Min Columns | 1 |
| Column Types | number |
| Notes | At least ~20 observations per group is recommended; below that the KDE shape is unreliable. |
Visual anatomy
Marks
area (mirrored)embedded box-plot
Channels
width (density)position-ymedian tick
Axes
x-categoricaly-quantitative
Guiding principles
Consider instead
Common mistakes
Wrong bandwidth (the KDE smoothing parameter — bin width is the histogram analogue)
Ignoring outliers
History
Introduced by Hintze and Nelson in 1998 as an improvement over box plots.
Accessibility notes
Provide summary statistics as text alternative.
Related reading
Got data? Let's see what works.
Drop your CSV. You'll get a Violin Plot plus four alternatives - ranked by which one actually fits your data best.