Guidelines
Suggest edit

Use violin plots instead of bar charts with error bars for inferential comparisons

For comparing grouped means with uncertainty, prefer a violin plot on quantitative summary charts to improve fidelity and mitigate within-the-bar bias for viewers making inferential judgments without deep statistical training.

  • purpose:select
  • basis:empirical
  • task:compare
  • chart:box-violin:use
  • chart:bar:avoid
  • quality:fidelity
  • lever:chart-family
  • operator:uncertainty

advice

Replace the bar body with a violin mark

Choose a violin plot when viewers must compare mean estimates with uncertainty. For example, use a symmetric violin centered on each mean and encode the inferential distribution with width instead of drawing a baseline-anchored bar with error bars.

reason

Why the violin mark improves inference

A violin mark removes the false containment cue created by the filled bar and shows likelihood continuously around the mean. This supports more symmetric judgments about possible outcomes and more restrained judgments about group differences.

Mechanism: Width around the mean gives viewers a continuous, symmetric cue that values farther from the mean are less likely, so they do not over-trust values that happen to fall inside a bar body.

Evidence: In crowd-sourced experiments, violin plots reduced within-the-bar bias in one-sample judgments and led to less inflated confidence and effect-size judgments than bar charts with error bars in inferential comparison tasks for general audiences (Correll & Gleicher, 2014).

Notes: For this inferential use, the paper’s violin plots encoded the probability distribution used for inference and omitted interior box-plot glyphs.

context

Use when comparing uncertain group means

  • User Goal: Predict which group is likely higher, or judge how strong a difference is.
  • Task: Compare mean estimates while accounting for margin of error or confidence intervals.
  • Data: Quantitative summaries shown as sample means with associated error.
  • Chart Setting: Grouped summary charts where the distribution of possible means matters more than the raw sample distribution.
  • Audience: Readers with mixed or limited statistical background.
  • Success Criterion: Judgments follow statistical expectation without overstating confidence or effect size.

exceptions

Do not use when the task is ratio reading

Break it when: The main task is comparing ratios rather than making inferential judgments about uncertain means. Why: The source notes that bar charts can outperform symmetric encodings for ratio comparison tasks.

costs

Tradeoffs of switching from bars to violins

Sacrifice: Familiarity with the standard bar chart. Risk: Some readers may prefer the familiar bar even when it supports worse inference. Mitigation: Use the violin when inferential accuracy matters more than adherence to convention.

mistakes

Common bar-chart fallback that fails

Mistake: Keep a filled bar with error bars and expect viewers to interpret likelihood symmetrically around the mean. Why it fails: The bar body makes values inside the bar feel more likely than equally distant values outside it.

check

Compare the two encodings directly

Failure Sign: Equally distant values above and below the mean do not feel equally likely, or small group differences feel too decisive. Quick Check: Mock up the same uncertain means as a violin plot and as a bar chart with error bars, then see which version produces more symmetric judgments around the mean. Stronger Test: Ask a few readers to judge likely winners and confidence on marginal comparisons; choose the version that produces less overconfidence.

fix

Edit the chart family and the mark shape

  • Replace each baseline-anchored bar and whiskers with a violin centered on the mean.
  • Encode the inferential distribution with width rather than using a filled bar area.
  • Remove interior box-plot glyphs if the task is about possible population means rather than the raw sample distribution.

References

Correll, M., & Gleicher, M. (2014). Error Bars Considered Harmful: Exploring Alternate Encodings for Mean and Error. IEEE Transactions on Visualization and Computer Graphics, 20(12), 2142–2151. https://doi.org/10.1109/TVCG.2014.2346298