Distributions and heavy tails

Violin, box, and ridgeline plots: comparing group distributions

When comparing experimental groups, violin, box, and ridgeline plots show distribution shape, skewness, and multiple modes that mean ± SD or mean ± SEM error bars hide completely. Layer a kernel density violin (or stacked ridgeline) with quartiles, medians, and raw points when sample sizes allow, reserve bare boxes for compact tables or tiny n<15 cohorts where smooth densities hallucinate peaks, and pair Per Group vs Common normalization carefully before reading peak heights across cohorts.

Updated · 6 min read

On this page
  1. Error bars, box plots, violins, and ridgelines compared
  2. KDE bandwidth, trim, and quartile conventions
  3. Normalization, sample size N, and ridgeline order
  4. How to build violin and ridgeline charts in Autoplot
  5. Distribution charts vs X&Y error bars in Autoplot
  6. Frequently asked questions

Error bars, box plots, violins, and ridgelines compared

Every group-comparison graphic trades compactness against how much structure survives aggregation:

Plot typeWhat it showsWhat it hidesBest when
Mean ± SD / SEMLocation and spread or precision around the meanSkew, outliers, gaps, and bimodal clustersSymmetric Gaussian errors where only offset is tested
Box plotMedian, Q1–Q3 box, 1.5×IQR whiskers, outliersBimodal peaks or troughs inside the interquartile boxQuick scan across many groups or small n with jittered points
Violin (+ Box + Points)Full mirrored KDE curve, two-level Split, box summary, raw dotsExact bin counts if bandwidth oversmooths small nComparing 2–10 conditions, especially paired treatments (Split)
Ridgeline plotOverlapping KDE lanes stacked along one value axisFine lower-tail overlap when large Overlap covers lanesTracking shifts across 4+ ordered batches, regimes, or time windows

Notice the Printed group below: in As-Built tests (Blue, left half), specimens cluster into two separate modes near 510MPa and 785MPa. A mean ± SEM bar—and even the solid quartile box alone—stretches straight across the empty trough around 640MPa where almost no observations actually sit.

Autoplot split violin distribution chart of Yield Strength in MPa across Cast, Rolled, Printed, and Forged process routes split by As-Built on the left in blue and Annealed on the right in yellow, showing bimodal lobes for Printed As-Built beside IQR boxes, medians, Tukey whiskers, outlier circles, and jittered points
Split violin + box + jittered points across 360 strength measurements: annealing removes the bimodal low-strength tail in Printed parts, a feature hidden inside the wide As-Built quartile box.

KDE bandwidth, trim, and quartile conventions

Understanding two numbers keeps you from misreading smooth density curves:

Kernel density estimation and Silverman's rule

Autoplot evaluates a 128-point Gaussian kernel density estimate for each subgroup:

fˆh(x)=1nh2π∑i=1nexp(−(x−xi)22h2)

With Bandwidth: Automatic, it selects Silverman's adaptive rule of thumb:

h=0.9min(s,Q3−Q11.34)n−1/5

Using the smaller of sample standard deviation s and scaled interquartile range keeps heavy outliers from flattening the core into one broad hump—just as choosing good bins prevents false smoothing in the histogram bin width guide. When Trim to Data stays enabled, curves clip cleanly at [xmin,xmax] rather than tapering ±3h beyond physical bounds; disable trimming only if you specifically want smooth tail decay past observed extremes.

Quartile fences and raw point thinning

When the Box layer is active, Autoplot interpolates Q1, median, and Q3 linearly at p(n−1) and draws Tukey whiskers to the furthest actual observations inside:

[Q1−1.5(Q3−Q1),Q3+1.5(Q3−Q1)]

Values outside those fences render as open Outliers rings even if jittered Points are toggled off. Above 2,000 total observations, raw dots thin evenly across sorted positions while density curves and quantile boxes still use all finite points.

Autoplot Data Inspector Mark panel for Distribution Chart showing Mode Violin or Ridgeline, layer checkboxes for Violin, Box, Median, Points, and Outliers, Automatic vs Custom Bandwidth, Equal Width vs Count scaling, Trim to Data, and Points Jitter slider set to 0.75
The Data Inspector Mark panel toggles Violin, Box, Median, Points, and Outliers independently, swaps Automatic vs Custom bandwidth, and switches Equal Width vs Count scaling.

Normalization, sample size N, and ridgeline order

Once curves cover several conditions, normalization and stacking order decide what catches the eye:

  • Per Group vs Common density (Ridgeline): Per Group scales every lane to fill the same peak crest height—great for comparing skewness or secondary bumps across tight vs broad regimes, while Common keeps area–density differences visible across the whole figure.
  • Equal Width vs Count scaling: Equal Width sets equal maximum half-width (or lane height) for every subgroup, whereas Count multiplies half-width by ng/nmax so sparsely sampled cohorts look visibly narrower instead of masquerading as equally well-sampled.
  • Order, rug ticks, and Mean + Median markers: order lanes chronologically or via Median: Low to High (Groups in Layout), add Rug ticks when raw sample density near thresholds matters, and compare Mean dots against Median bars: notice in Printed below how the bimodal lower cluster pulls the mean left of the 750MPa reference target even while the median sits comfortably near 790MPa.
  • Compare alongside cumulative views: if your primary claim is about extreme tail exceedance or power-law scaling rather than central modes, switch to a CCDF plot or check PDF vs CDF vs CCDF.
Autoplot horizontal Ridgeline plot of Cast, Rolled, Printed, and Forged yield strength ordered Median Low to High with gradient fills in Palette by Group, vertical Median ticks inside each ridge, Mean dots on baselines, Rug tick marks, and a dotted vertical Target 750 MPa reference line
Horizontal Ridgeline view ordered from lowest to highest median, pairing Palette by Group gradient fills with Mean dots, Median bars, Rug ticks, and a 750 MPa Target line.

How to build violin and ridgeline charts in Autoplot

Autoplot places distribution charts inside Charts figures (Analyze & Plot, Plus — free for 30 days) and accepts both tidy Long tables and multi-column Wide tables:

  1. Create a Charts figure: in Analyze & Plot, click New Figure → Charts, then choose Add Series → Distribution Chart in the figure toolbar.
  2. Choose Shape (Long or Wide) in Data: for Long tables, assign numeric Value, Group (numeric or categorical), and an optional Split column with exactly two non-empty levels for mirrored split violins. For Wide tables, tick each variable to compare (with optional TeX display labels such as \epsilon or tex:x_i).
  3. Configure Mark layers or switch to Ridgeline: in Violin mode, mix Violin, Box, Median, Points (Jitter), and Outliers, plus Bandwidth (Automatic / Custom), Width (Equal Width / Count), and Trim to Data. Flip Mode to Ridgeline for Horizontal/Vertical orientation, Overlap, Normalize (Per Group / Common), Height, Markers (None, Median, Mean, Mean + Median), and Rug.
  4. Style and inspect thresholds in Formatting: open Figure Inspector → Formatting to edit titles, axis labels, exact Value Range: Custom bounds, Show Reference Line, Fill (Solid, Gradient, Outline), and Coloring (Single Color vs Palette by Group), then toggle Legend when using Split or drop finished figures into a multi-panel board and export a vector PDF.
In Autoplot

Distribution charts vs X&Y error bars in Autoplot

Knowing which Autoplot figure type owns each summary prevents unnecessary workarounds:

  • What Distribution Chart computes natively: GPU/vector-sharp Gaussian KDE densities (128 grid samples via Accelerate), Silverman bandwidth selection, linearly interpolated quartiles (Q1, median, Q3), Tukey 1.5×IQR fences, deterministic FNV-1a point jittering, two-level split mirrors, stacked ridgelines, custom TeX labels, and editable Matplotlib / vector PDF exports.
  • Where SD/SEM error bars and inference live: Distribution Chart displays density curves, quartile boxes, medians, arithmetic means, and raw points rather than parametric bar charts with ± SD/± SEM error bars. For Constant or Variable error bars and confidence ribbons (Between Variables / Around Series), use an X&Y Plot figure (or E-S Scaling for SD/SEM log-binned spreads).
  • Hypothesis tests stay outside the plot card: Autoplot's Charts mode does not run ANOVA, Kruskal–Wallis, or pairwise p-value brackets on top of violins; ask Autoplot's local AI Assistant (Execute mode) or your own Python script when you need significance statistics alongside exported distribution figures.

See features and pricing.

Frequently asked questions

Frequently asked questions
When should I use a box plot instead of a violin or ridgeline plot?Use a box plot with jittered points when sample size per group is tiny (n<15) or identical across dozens of categories, because KDE violins on very small samples can suggest false shoulders. Switch to violin or ridgeline layers once groups have roughly 15–30+ observations and distribution shape or multimodality matters.
What is the difference between Equal Width and Count scaling on a violin plot?Equal Width gives every group (and each half of a Split violin) the same peak width so you can compare shape easily even between unequal cohorts. Count multiplies each group's peak half-width by ng/nmax, visibly shrinking smaller groups so sample-size imbalances are clear at a glance.
What does Normalize: Per Group vs Common do in a ridgeline plot?Per Group normalizes each ridge by its own maximum density, giving every group the same crest height regardless of spread. Common divides all ridges by the single highest density anywhere in the chart, making narrow, tightly concentrated groups rise taller than flat, broad distributions.
Can Autoplot plot parametric mean ± SEM error bars inside Distribution Chart?No. Distribution Chart focuses on raw observations, non-parametric quartiles/whiskers, Gaussian KDE curves, and optional mean/median markers. For Constant or variable-backed ± SD/± SEM error bars and shaded ribbons, use an X&Y Plot layer instead.

Sources

Algorithm details (Gaussian KDE on 128 samples via Accelerate, Silverman bandwidth 0.9min(s,IQR/1.34)n−1/5, Trim to Data, linear quantile interpolation, 1.5×IQR Tukey whiskers, ng/nmax Count scaling, 2,000-point stride thinning with deterministic jitter, and Per Group vs Common ridgeline normalization) and UI labels (Distribution Chart, Charts, Long/Wide, Split, Mark, Formatting) were verified directly against Autoplot source (DistributionChartDataPreparer.swift, DistributionChartCard.swift, DistributionRidgelineLayout.swift, DistributionChartEditor.swift, DistributionChartFormattingInspector.swift, and docs/user-wiki/09-charts-mode.md) and live Light/Dark captures on 5 December 2026. Method references: Jerry L. Hintze and Ray D. Nelson, "Violin Plots: A Box Plot-Density Trace Synergism," The American Statistician 52(2), 181–184 (1998), DOI 10.1080/00031305.1998.10480559; Robert McGill, John W. Tukey, and Wayne A. Larsen, "Variations of Box Plots," The American Statistician 32(1), 12–16 (1978), DOI 10.1080/00031305.1978.10479236; and Claus O. Wilke, Visualizing many distributions at once (Fundamentals of Data Visualization).

Try it on your own data.

Build layered split violin, box, and ridgeline charts from long or wide tables on Apple silicon. Distribution Charts are part of Autoplot Plus (free for 30 days).

Compare PDF vs CDF vs CCDF →
Download .dmg

Without Private Cloud Compute · macOS 15–26

Apple silicon · macOS 15 or later · Free plan · Plus free for 30 days · 11 starter AI credits

Send to my Mac

Autoplot runs on a Mac. Send the link to yourself, or open it in the Mac App Store.