
Choosing between a violin plot vs box plot comes down to distribution shape versus concise summary statistics. A box plot displays five summary values and explicit outliers, while a violin plot mirrors a Kernel Density Estimate (KDE) to reveal multiple peaks and skew. Use a box plot with raw points for small groups, and a violin or raincloud plot when larger samples may hide subpopulations.
Compare a violin plot and a Tukey box plot on your own data. Try the free Violin Plot Maker → Vizcept is an AI scientific figure generator whose browser-based tool renders violin and box plots with code, supporting optional raw points, bandwidth controls, and watermark-free editable SVG or 300 DPI PNG downloads.
A box plot encodes exact order statistics across five key points (minimum, Q1, median, Q3, and maximum), whereas a violin plot mirrors a smoothed density curve around a central axis.
In a Tukey box plot, the box spans the Interquartile Range (IQR = Q3 − Q1) from Q1 (25th percentile) to Q3 (75th percentile), holding the middle 50% of values around the median (Q2, 50th). In Matplotlib pyplot.boxplot (whis=1.5) and R boxplot.stats (coef=1.5), whiskers stop at the furthest observed values inside Q1 − 1.5 × IQR and Q3 + 1.5 × IQR; points outside plot as outliers (fliers).
Whisker rules vary by standard. The NIST Handbook draws basic whiskers to sample min and max, while its outlier guide flags values past 1.5 × IQR as mild and past 3 × IQR as extreme outliers (abnormally distant points, not automatic errors).
Introduced by Hintze and Nelson (1998), a violin plot rotates a KDE curve 90 degrees and mirrors it symmetrically. Width shows estimated density, not sample count. While Seaborn violinplot adds an inner box (inner='box'), Matplotlib pyplot.violinplot defaults to showmedians=False, showmeans=False, and showextrema=True, leaving only the density outline and extrema bars.
Core structural differences among a box plot, a violin plot, and a raincloud plot include:
| Feature | Box Plot (Tukey) | Violin Plot (KDE) | Raincloud Plot |
|---|---|---|---|
| Encoding | Q1, median, Q3, whiskers, fliers | Mirrored KDE curve | Half-violin + points + box |
| Bimodality | Hidden inside IQR | Visible modes & valleys | Visible peaks + raw points |
| Outliers | Explicit (1.5 × IQR) | Stretched thin tails | Raw points + fliers |
Sample size (n) | Hidden unless added | Hidden unless scaled/pointed | Every point visible |
| Smoothing | None (quartile rule only) | High (bandwidth & cut) | Cloud only; points raw |
| Best range | Unimodal (+ points if n < 100) | Rule of thumb: n >= 30 (clearest >= 100) | Medium-to-large cohorts |
A violin plot exposes bimodal subpopulations, clusters, and gaps that share identical medians and IQRs in a box plot. When groups mix responders and non-responders, or distinct cell states, a five-number summary flattens two peaks into one rectangle.
Choonpradub and McNeil showed that box plots lose shape whenever data depart from one peak. Three n = 80 groups sharing nearly identical Q1, median, Q3, and whiskers (unimodal normal, bimodal, and uniform) yield nearly identical box plots, while violins separate the central bulge, pinched waist, and flat shoulders immediately.

No. Treating a violin plot as an automatic upgrade over a box plot hurts clarity in many scientific papers. Swapping to a bare violin removes explicit 1.5 × IQR outlier dots, stretches extreme values into narrow tips, and implies smooth density that small samples cannot support.
For skew checks and fast group comparisons, a box plot stays easier to scan: an off-center median line and unequal whisker lengths flag skewness at a glance, whereas a violin plot shows how steeply the long tail tapers. Inspect both views during exploration, keep a box plot for unimodal groups where specific outliers matter, and switch to a violin with inner quantiles when multimodality alters the conclusion.
No single minimum sample size separates valid from invalid violin plots, because KDE accuracy depends on group size (n) and true shape. Peer-reviewed guidelines divide n into practical ranges instead.
In a KDE bandwidth-selection benchmark across n = 15 to 2,000, accuracy shifted with sample size and density complexity rather than one cutoff. For biomedical papers, Weissgerber et al. (2017, J Biol Chem) recommend univariate dot or scatter plots when n <= 10.
Simulations by Weissgerber et al. (2019, Circulation) across normal, skewed, and bimodal data showed shape was clear at n = 100, hard to judge at n = 20, and impossible at n = 5. The JBMR data guide notes raw points stay resolvable for n < 100 and requires them for small groups.
Practical rule-of-thumb chart choices (not hard statistical cutoffs) by sample size and study design include:
| Sample Size / Design | Recommended Plot | Reason |
|---|---|---|
n <= 10 per group | Dot plot, strip chart, or beeswarm | Too sparse for KDE or quartiles; show every point. |
n = 11 to 29 | Box plot + jittered/beeswarm points | Gives quantiles without inventing smooth peaks. |
n = 30 to 99 | Violin + inner box + points (or raincloud / SinaPlot) | Shows bimodality while keeping raw points verifiable. |
n >= 100 | Violin + inner box/quartiles (or raincloud) | Avoids dot overplotting in large cohorts. |
| Paired / repeated | Paired line plot or within-pair differences | Independent groups hide subject-level trajectories. |
Paired and repeated-measures studies need a separate layout. As Weissgerber et al. (2015, PLOS Biology) and follow-up statistical reporting guidance show, separate pre- and post-treatment boxes or violins hide subject-level trajectories. Connect matched pairs with lines or plot within-pair differences. Under the Nature Reporting Summary, report exact discrete n, units, and independent versus repeated measurements.
Configuring an honest violin plot requires setting four parameters: bandwidth, tail truncation (cut / trim), width scaling (density_norm / scale), and interior markers. Unchecked defaults can invent modes, paint density past physical limits, or mask unequal group sizes.
Bandwidth sets KDE smoothness. Hintze and Nelson (1998) and a EuroVis 2023 study document two opposing traps: over-smoothing with wide bandwidth merges real peaks into one hump, while under-smoothing with narrow bandwidth turns noise into fake bumps.
The KDE bandwidth-selection benchmark recommends biased cross-validation or Silverman's rule for n = 25–100, and adaptive Sheather–Jones plug-in estimation for larger samples. In Seaborn 0.13.2, bw_method defaults to 'scott' and bw_adjust to 1; test narrower and wider multipliers before finalizing. For skewed assays like RNA-seq counts, log-transform data before KDE estimation.
ggplot2 defaultsTail extension differs between Python and R. Seaborn's default cut=2 extends density two bandwidths past extremes, painting curves below zero on zero-bounded measures like reaction time; cut=0 creates a truncated violin plot confined to sample min and max. In R, ggplot2::geom_violin() defaults to trim = TRUE, bw = "nrd0" (Silverman), adjust = 1, and scale = "area", often paired with + geom_boxplot().

Check two more Seaborn controls before saving. First, density_norm defaults to 'area', giving equal area to n = 15 and n = 120 groups; switch to 'count' to scale width by n, or 'width' for equal peak width, and state the rule in your caption. Second, pair shells with inner='box', 'quart', 'point', or 'stick' to show quantiles or raw observations.
Two box plots from identical numbers can draw different Q1 and Q3 edges because software defaults to different finite-sample quartile algorithms. A shifted edge across tools usually signals an algorithm mismatch rather than a data bug.
R stats::quantile offers nine Hyndman–Fan algorithms (type = 1 to 9, default 7). NumPy percentile() defaults to method='linear' (Type 7). Since version 4.0.3, ggplot2 geom_boxplot() accepts quantile.type from 1 to 9 (default 7).
Base R and Excel depart from Type 7 predictably. Base R boxplot.stats() uses Tukey hinges, matching quartiles for odd n but differing for even n: quartiles fall on observations when n %% 4 == 1, whereas hinges also fall on observations when n %% 4 == 2, taking midpoints otherwise. In Microsoft Excel's Box and Whisker chart, Inclusive median includes the median when N is odd while Exclusive median excludes it, shifting Q1 and Q3 on odd groups.
Default quartile rules across major tools include:
| Software / Function | Default Algorithm | Practical Difference |
|---|---|---|
R stats::quantile() | Hyndman–Fan Type 7 | Types 1–9 available; differs from base R boxplot() on even n. |
Base R boxplot.stats() | Tukey hinges | Matches odd n; differs on even n (n %% 4 == 2). |
R ggplot2::geom_boxplot() | Hyndman–Fan Type 7 | quantile.type configurable since ggplot2 4.0.3. |
| Python NumPy / Matplotlib | Linear interpolation (Type 7) | Matches R quantile(type = 7). |
| Microsoft Excel Box & Whisker | Inclusive or Exclusive median | Changes Q1 and Q3 on odd N; state choice in Methods. |
When tables and boxes disagree, check the quartile rule first. Researchers can compare four conventions (TI-84 halves, Tukey hinges, Excel Inclusive / R & NumPy Type 7, and Excel Exclusive) with step-by-step math in Vizcept's Box Plot Maker, with free watermark-free SVG and 300 DPI PNG exports.
Researchers rarely need a plain box plot or a bare violin plot alone. Hybrid layouts combine density shape, quantiles, and raw points while replacing bar-and-error ("dynamite") plots for continuous outcomes.
Popularized by Allen et al. (Wellcome Open Research), a raincloud plot pairs a half-violin ("cloud"), jittered raw points ("rain"), and a compact box summary. Readers verify n alongside peaks and medians, though the cloud still inherits KDE bandwidth sensitivity.
When individual values matter more than smooth curves, point-based plots skip KDE assumptions. A Beeswarm plot offsets coincident points horizontally without overlap. A SinaPlot (Sidiropoulos et al., 2018) restricts horizontal jitter by normalized density, forming a violin silhouette purely from real points.
Notched box plots draw an interval of roughly ±1.58 × IQR / √n around each median (per R boxplot.stats). Non-overlapping notches offer a rough visual check for median differences at about 95% confidence, though readers must not confuse notches with box bounds or standard error bars.
For many ordered groups (such as expression across timepoints), staggered horizontal densities in ggridges::geom_density_ridges read cleaner than narrow vertical violins. Setting scale=1 lets the tallest peak touch the next baseline; note that ggridges::stat_density_ridges pools bandwidth across the full dataset by default.

Export statistical plots as editable vector files whenever your journal accepts them, sized to final column width before saving. Resizing a raster screenshot blurs tick labels, distorts whiskers, and triggers production rejections.
Major publisher specifications differ sharply across Nature Research Figure Guide (export panels) and PLOS Figure Guidelines:
| Specification | Nature Research Figure Guide | PLOS Figure Guidelines |
|---|---|---|
| Preferred format | Editable vector .ai, .eps, .pdf (plain .svg acceptable) | TIFF or EPS only (< 10 MB) |
| Resolution | Vector line art/text (do not rasterize); photos >= 300 dpi (450 dpi rec.) | 300–600 dpi |
| Print dimensions | 89 mm (1-col), 183 mm (2-col), max height 170 mm | 789–2,250 px wide, max 2,625 px tall (at 300 dpi) |
| Typography | 5–7 pt; recommends standard sans-serif (Arial or Helvetica); RGB | 8–12 pt; Arial, Times, or Symbol |
In Python, Matplotlib savefig exports SVG, PDF, EPS, or PNG with explicit dpi and bbox_inches='tight'.
Four caption items to verify before submitting any violin plot vs box plot figure are:
n, unit, and independent versus repeated design per group.1.5 × IQR observed-value whiskers or min–max, quartile method).bw_adjust, cut=0/trim, density_norm).±1.58 × IQR / √n notches, or raw observations).Microsoft Excel includes native Box and Whisker and Histogram charts, but it has no built-in violin plot per Microsoft's Office chart list. Paste spreadsheet columns into R, Python, or a browser-based violin plot maker instead of manual area-chart workarounds.
cut=0)?Truncate a violin plot with cut=0 (or trim = TRUE in ggplot2) whenever measurements have a hard physical boundary such as zero-floored concentrations or 0–100% scores. Truncation stops the KDE from implying impossible values past observed extremes, though the interior curve remains smoothed.
No, a Tukey box plot marks the median rather than the mean, and Matplotlib's default violin plot marks neither. When your test compares means (such as a t-test or ANOVA), overlay an explicit mean symbol and define it in the legend.
Yes. Pasting columns or opening a CSV in Vizcept's browser-based tools renders locally, and downloading editable Scalable Vector Graphics (SVG) or 300 DPI Portable Network Graphics (PNG) files is free with no watermark and zero credits. Only the optional "Describe with AI" feature uses 2 credits per request.
Use a histogram for binned frequency counts on one group without KDE smoothing. Use a dot plot when n <= 10 per group or when integer counts should stay stacked on a number line.

Compare conceptual framework vs theoretical framework with a worked TAM-to-model example, SEM path-diagram rules, thesis chapter placement, and peer-review checks.

A 2026 playbook for composing Nature- and Science-grade multi-panel figures — from the editorial spec sheet to a panel-as-sentence narrative grid and a rejection-proof self-audit.

A practical workflow for turning research ideas into clear, journal-ready scientific diagrams without rebuilding every figure from scratch.
Join the community
Subscribe to our newsletter for the latest news and updates