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)

Monthly salary by department (violin plot, illustrative)Width shows how many people earn each amount; the white bar is the middle half and the dot the median. Sales has two peaks, near 40 and 55 thousand.SEK thousand per month203040506070SupportEngineeringSales
Monthly salary by department (violin plot, illustrative)Width shows how many people earn each amount; the white bar is the middle half and the dot the median. Sales has two peaks, near 40 and 55 thousand.SEK thousand per month203040506070SupportEngineeringSales
Width shows how many people earn each amount; the white bar is the middle half and the dot the median. Sales has two peaks, near 40 and 55 thousand.

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.
Example of the input layout: Long tableA long table: one row per observation, few columns. New data adds rows.GroupValueAABBC
A long table: one row per observation, few columns. New data adds rows.

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.

GroupValue
A10
A12
A18
B11
B23