Charts

Grouped Violin Plot

A hybrid clustered plot displaying density curves alongside summary elements.

What is a grouped violin plot?

Grouped violin plots are a powerful tool for displaying larger samples of clustered data. They are typically a hybrid plot between a box plot and a mirrored density plot. The "violin" shape itself depicts the data's underlying distribution, with its varying width directly proportional to the concentration of data points at different values. This density is typically estimated and smoothed using a Gaussian kernel. By clustering the data, grouped violin plots enable clear side-by-side comparisons both between different groups and across their respective subcategories.

Traditionally, box plot summary statistics are overlaid onto the violin's density estimates. However, Graphmatik offers you the flexibility to overlay a spread plot instead. This alternative visual highlights the mean ± error (e.g., range, SEM, SD, 95% CI), providing a different perspective than the quartile-based summary of a standard box plot.
WARNING: Violin plots showing the mean ± error are NOT as common as box plot overlays. So you should always describe what these chart elements represent to the reader.
Default grouped violin plot
A clustered visual that combines a box plot with kernel density estimation
Grouped vertical violin plot showing two clusters and three subgroups with Graphmatik's default styling applied.

When to use violin plots

Violin plots excel when working with larger datasets, where there is sufficient data points to reliably estimate the probability density and the sheer volume of data makes distribution dot plots appear visually cluttered and dense.

For smaller datasets, overlaying a distribution dot plot onto "bar", "spread" or "box" plots can provide as rich an understanding of the underlying data distribution as violin plots. Furthermore, unlike violin plots, dot plots also conveniently show the number of observations present.
Make sure to check out these tips on how to create beautiful grouped plots
Easily swap directions
Alternate between vertical and horizontal violin plots by toggling between columns or rows.
A horizontal grouped violin plot showing two clusters, each containing three subgroups arranged from smallest to largest. The overall largest subgroup across clusters is highlight in purple.

Chart properties

PropDefaultDescription
central tendencymedian
median
The middle most value of a sorted set of numbers.
mean
The sum of a set of values divided by the number of values in the set.
whiskersrange
range median or mean
The difference between the highest and lowest values within a set.
1.5 * Interquartile range (1.5*IQR) median
A range representing Q1 - 1.5 * IQR and Q3 + 1.5 * IQR.
2.5 percentile - 97.5 percentile (2.5-97.5 %tile) median
The difference between the 2.5 percentile and the 97.5 percentile, representing the middle 95% of a set.
standard error of the mean (SEM) mean
How much the sample means vary from the population mean.
standard deviation (SD) mean
A measure of the variation of a set of values around their mean.
95% confidence interval (95% CI) mean
95% probability that the population parameter lies within this range.
sortnone
none
The clusters are arranged in insertion order.
ascending
Clusters are arranged from smallest to largest.
descending
Clusters are arranged from largest to smallest.
group byfactor
factor
Bars will be grouped by the selected factor, with the other factor defining the subgroups.