On this page
Error bars, box plots, violins, and ridgelines compared
Every group-comparison graphic trades compactness against how much structure survives aggregation:
| Plot type | What it shows | What it hides | Best when |
|---|---|---|---|
| Mean ± SD / SEM | Location and spread or precision around the mean | Skew, outliers, gaps, and bimodal clusters | Symmetric Gaussian errors where only offset is tested |
| Box plot | Median, – box, whiskers, outliers | Bimodal peaks or troughs inside the interquartile box | Quick scan across many groups or small with jittered points |
| Violin (+ Box + Points) | Full mirrored KDE curve, two-level Split, box summary, raw dots | Exact bin counts if bandwidth oversmooths small | Comparing 2–10 conditions, especially paired treatments (Split) |
| Ridgeline plot | Overlapping KDE lanes stacked along one value axis | Fine lower-tail overlap when large Overlap covers lanes | Tracking 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 and . A mean ± SEM bar—and even the solid quartile box alone—stretches straight across the empty trough around where almost no observations actually sit.
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:
With Bandwidth: Automatic, it selects Silverman's adaptive rule of thumb:
Using the smaller of sample standard deviation 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 rather than tapering 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 , median, and linearly at and draws Tukey whiskers to the furthest actual observations inside:
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.
Normalization, sample size N, and ridgeline order
Once curves cover several conditions, normalization and stacking order decide what catches the eye:
Per GroupvsCommondensity (Ridgeline):Per Groupscales every lane to fill the same peak crest height—great for comparing skewness or secondary bumps across tight vs broad regimes, whileCommonkeeps area–density differences visible across the whole figure.Equal WidthvsCountscaling:Equal Widthsets equal maximum half-width (or lane height) for every subgroup, whereasCountmultiplies half-width by so sparsely sampled cohorts look visibly narrower instead of masquerading as equally well-sampled.- Order, rug ticks, and
Mean + Medianmarkers: order lanes chronologically or viaMedian: Low to High(GroupsinLayout), addRugticks when raw sample density near thresholds matters, and compareMeandots againstMedianbars: notice inPrintedbelow how the bimodal lower cluster pulls the mean left of the reference target even while the median sits comfortably near . - 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.
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:
- Create a
Chartsfigure: inAnalyze & Plot, clickNew Figure→Charts, then chooseAdd Series→Distribution Chartin the figure toolbar. - Choose
Shape(LongorWide) inData: for Long tables, assign numericValue,Group(numeric or categorical), and an optionalSplitcolumn 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\epsilonortex:x_i). - Configure
Marklayers or switch toRidgeline: in Violin mode, mixViolin,Box,Median,Points(Jitter), andOutliers, plusBandwidth(Automatic/Custom),Width(Equal Width/Count), andTrim to Data. FlipModetoRidgelineforHorizontal/Verticalorientation,Overlap,Normalize(Per Group/Common),Height,Markers(None,Median,Mean,Mean + Median), andRug. - Style and inspect thresholds in
Formatting: openFigure Inspector → Formattingto edit titles, axis labels, exactValue Range: Custombounds,Show Reference Line,Fill(Solid,Gradient,Outline), andColoring(Single ColorvsPalette by Group), then toggleLegendwhen usingSplitor drop finished figures into a multi-panel board and export a vector PDF.
Distribution charts vs X&Y error bars in Autoplot
Knowing which Autoplot figure type owns each summary prevents unnecessary workarounds:
- What
Distribution Chartcomputes natively: GPU/vector-sharp Gaussian KDE densities (128grid samples viaAccelerate), Silverman bandwidth selection, linearly interpolated quartiles (, median, ), Tukey fences, deterministic FNV-1a point jittering, two-level split mirrors, stacked ridgelines, custom TeX labels, and editable Matplotlib / vector PDF exports. - Where
SD/SEMerror bars and inference live:Distribution Chartdisplays density curves, quartile boxes, medians, arithmetic means, and raw points rather than parametric bar charts with± SD/± SEMerror bars. ForConstantorVariableerror bars and confidence ribbons (Between Variables/Around Series), use anX&Y Plotfigure (orE-S ScalingforSD/SEMlog-binned spreads). - Hypothesis tests stay outside the plot card: Autoplot's
Chartsmode does not run ANOVA, Kruskal–Wallis, or pairwise -value brackets on top of violins; ask Autoplot's local AI Assistant (Executemode) or your own Python script when you need significance statistics alongside exported distribution figures.
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 () 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 , 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 , Trim to Data, linear quantile interpolation, Tukey whiskers, 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).