Distribution
Violin plot
Shows an estimated distribution as a symmetric density shape, optionally with summary marks.
- Plot
- Distribution
- Comparison
What it answers
How does the whole distribution shape differ by group?
- Shape
- Mirrored density silhouettes
- What it shows
- Skew, modes, tails and spread.
Example
The question
How does the shape of salaries differ between three departments?
Monthly salary by department (violin plot, illustrative)
Illustrative data. It belongs to no company.
When to use it
Use it when
Comparing shape, including possible multiple modes.
Avoid it when
Small samples or unexplained width normalisation.
How to read it
Compare silhouette width at the same value and use the density key.
Note
Bandwidth, trimming and width scaling vary.
The data you need
- Layout
- Long table
- Fields
- Group: text; Value: number
- One row is
- One raw observation belonging to a group. What is the grain?
- Rules
- Retain individual observations and group labels. State weighting and missing-data rules.
- Optional
- For box plots only, some tools accept Group,Q1,Median,Q3,WhiskerLow,WhiskerHigh plus separate outliers. Other distributions usually need raw data.
- Preparation
- Keep raw numeric observations, group them if needed and handle missingness explicitly. Choose bins, bandwidth or summary conventions as appropriate to this specific plot.
- Units
- The measurement axis retains its original unit. Frequency uses observations; normalised frequency divides by group sample size; density also depends on interval width.
Worked example
Example groups have estimated density peaks at 10 and 20. Draw violins with common bandwidth/scaling; compare peak positions rather than silhouette area.
| Group | Value |
|---|---|
| A | 10 |
| A | 12 |
| A | 18 |
| B | 11 |
| B | 23 |
