Violin Plot Explained: How to Make, Read and Report It
A violin plot shows the full shape of a distribution for each group, not just its median and quartiles. It is most valuable when two groups share similar summary statistics but differ in shape, for example one unimodal group and one bimodal group.
What is a violin plot?
It combines a box-plot-style summary with a mirrored kernel density estimate (Hintze & Nelson, 1998). Width at any height reflects the estimated density of observations at that value. It requires a continuous (or finely measured) outcome and one or more groups.
The mathematics
The kernel density estimate for n observations x1…xn is:
f̂(x) = (1 / nh) Σ K((x − xi) / h)
K is a kernel (often Gaussian) and h the bandwidth. A common rule of thumb (Silverman, 1986) is h = 0.9 · min(s, IQR/1.34) · n−1/5. Small h gives a jagged, over-detailed shape; large h smooths away real features. Bandwidth is the most important setting to understand, because it can change the story.
Original example (illustrative)
Suppose three teaching methods are compared on exam scores (n = 40 per group). Illustrative summaries: Method A median 68, IQR 62–74; Method B median 68, IQR 61–75; Method C median 69, IQR 60–76. A box plot would suggest the groups are nearly identical. A violin plot, however, might reveal that Method C is bimodal, with clusters near 58 and 80, hinting that the method works very well for some students and poorly for others. That is a hypothesis for further investigation (for example, a moderator such as prior knowledge), not a conclusion from the plot alone.
How to make it in StatFAS
Open the Violin Plot Generator. Arrange data in a group column and a numeric column (or one column per group).
Reading and reporting
Check width (density), the number of peaks, symmetry, tails and the inner summary. Do not read violin tails past the data range as meaningful: the kernel can extend beyond the observed minimum and maximum unless trimmed. With small groups (below roughly 20), smooth shapes can look more certain than they are; overlay raw points where possible. A figure caption can read: Violin plots of exam scores by teaching method; inner lines show quartiles; n = 40 per group. Pair the plot with numeric tests such as Mann-Whitney U for two groups, since the plot itself does not test differences.
Common mistakes
Using violins for tiny samples, omitting bandwidth information, comparing groups of very different sizes without noting n, and using them for discrete data with few values, where the smoothed shape is misleading.
Alternatives
Box plots (more compact), histograms (shows bins), density plots, and raincloud or beeswarm plots (show individual points).
Conclusion
Use a violin plot to reveal shape, then follow with an appropriate inferential test and honest reporting of sample size and smoothing.
1.
statfas-violin-plot-interface.png, alt: "StatFAS Violin Plot Generator interface"2.
statfas-violin-plot-example-data.png, alt: "Example data entered in the StatFAS Violin Plot Generator"3.
statfas-violin-plot-settings.png, alt: "Violin Plot Generator settings in StatFAS"4.
statfas-violin-plot-result.png, alt: "Violin Plot Generator result generated in StatFAS"References
- Hintze, J. L., & Nelson, R. D. (1998). Violin plots: A box plot-density trace synergism. The American Statistician, 52(2), 181–184.
- Silverman, B. W. (1986). Density estimation for statistics and data analysis. Chapman & Hall.