Split Violin Plot: What It Is, When to Use It and How to Read It

Split violin plots put two sub-groups back to back in one shape; here is when they help and how to avoid misleading ones.

A split violin plot draws two half-violins back to back in the same slot, one for each level of a second variable. Instead of placing “before” and “after” as two separate violins, each half shows one of them, so you can compare the two shapes directly across the center line. It works best when the second variable has exactly two levels.

This article explains what a split violin shows, when it is the right choice, how to read one, how to make one, and the mistakes to avoid. If you want to look at each group on its own first, you can create a violin plot online from a pasted list of numbers.

What a split violin plot is

A regular violin plot is symmetric: the same density curve is mirrored on both sides of a center line. That mirroring is purely visual. The left half and the right half carry the same information.

A split violin uses that redundant space. The left half shows the distribution for one sub-group and the right half shows the distribution for another. You end up with one asymmetric shape per category on the x-axis, and the two halves can be compared value by value.

A typical example: the x-axis shows four treatment groups, the y-axis shows a measurement, and the two halves of each violin show male and female participants. Or the halves show “control” and “treated” within each cell type. The second variable is usually called the hue variable, after the parameter name in seaborn.

If you need a refresher on how the density shape itself works, see how to read a violin plot, or our main violin plot guide.

When to use a split violin

Split violins are a good fit when:

  • You have a two-level comparison inside each category. Before/after, control/treatment, two sexes, two time points, two versions of a product.
  • The shape comparison matters. If you care about whether one sub-group is more skewed or has an extra peak, putting the halves back to back makes that visible.
  • Space is tight. A split violin uses one slot per category instead of two, so the chart stays compact when there are many categories.
  • Each sub-group has enough data. Each half is its own density estimate, so the same sample size cautions apply to each half separately.

They are a poor fit when:

  • The hue variable has more than two levels. There are only two sides to a violin. Seaborn 0.13 no longer requires exactly two hue levels for split=True, but with three or more levels the result is a row of half-violins, not a single back-to-back comparison, and it is harder to read.
  • The audience has not seen violin plots before. A split violin adds a second idea on top of an already unfamiliar chart. Make the legend and caption very clear.
  • The two sub-groups differ a lot in size. More on this in the pitfalls section.

How to read a split violin plot

Read it in this order:

  1. Find the legend. Confirm which color or side belongs to which sub-group. Do not assume left means “first” or “control”.
  2. Compare the halves within one category. Look across the center line. Is one half shifted up or down? Is one wider at the top and the other at the bottom?
  3. Look at the inner marks. With quartile lines on each half, you can compare medians and interquartile ranges directly. A dashed median line that sits higher on one side means that sub-group has a higher median.
  4. Compare across categories. Check whether the same pattern (for example, “treated is higher”) holds in every category, or only some.
  5. Check the sample sizes. If the tool does not show them, find them before drawing conclusions about shape.

What asymmetry tells you

If both halves are mirror images, the two sub-groups have similar distributions. If one half bulges where the other is thin, the sub-groups are concentrated in different ranges. If one half has two bulges and the other has one, one sub-group probably contains a mix of two populations. These shape differences are the main thing a split violin is built to reveal.

How to make a split violin plot

Python (seaborn 0.13)

In seaborn, pass a hue variable and set split=True:

import seaborn as sns
import matplotlib.pyplot as plt

# df has "group", a two-level "condition" column, and "value"
sns.violinplot(data=df, x="group", y="value", hue="condition",
               split=True, inner="quart", gap=0.1)
plt.savefig("split_violin.png", dpi=150)

A few notes on this code:

  • inner="quart" draws dashed lines at the quartiles on each half. With the default inner="box", seaborn draws a narrow box for each half next to the center line, which also works but is smaller.
  • gap=0.1 (new in 0.13) leaves a small space between the two halves, which can make the boundary clearer.
  • Control the order of the halves with hue_order, for example hue_order=["before", "after"].
  • By default (common_norm=False), seaborn normalizes widths separately within each hue level, so the “before” halves are scaled against each other and the “after” halves against each other. Set common_norm=True to normalize all halves on one shared scale.

For a broader walkthrough of seaborn violin plots, see violin plots in Python.

R (ggplot2)

ggplot2’s geom_violin() has not traditionally offered a split option, so people usually use an extension package or a custom geom shared in community answers. Check the documentation for your installed version before adding one. Our violin plot in R guide covers the regular violin; for split violins, look for an extension that adds a split violin geom and check that it is maintained.

Without code

If you just need a standard violin chart from a list of numbers, you can use our free violin plot maker in the browser.

Pitfalls to watch for

Unequal group sizes

Each half is drawn from its own density estimate. With area scaling (the default in seaborn), a half built from 15 points can look as substantial as a half built from 1,500. Readers will assume the halves are equally reliable. Fix this by showing n in the legend or labels, or by using count-based width scaling so the smaller group is visibly thinner. In seaborn that means density_norm="count" together with common_norm=True; without common_norm=True, the counts are only compared within each hue level, not between the two halves.

Different bandwidths per half

Each half gets its own bandwidth from its own data. If one sub-group is much more spread out than the other, its curve will be smoothed more. That is usually fine, but it means some shape differences come partly from the smoothing. Our guide to violin plot bandwidth explains how this works.

Mixing up sides and colors

When the halves differ only by color, readers with color vision deficiency may not tell them apart. Use a palette with a clear lightness difference between the two colors, and keep the legend close to the plot.

Tails extending past the data

With seaborn’s default cut=2, each half extends a little past its own minimum and maximum. If the two sub-groups have different ranges, that extension can look like a real difference in tails. Set cut=0 to trim each half to its data.

Implying pairing that does not exist

A split violin puts two groups side by side, but it does not show whether the same subjects appear in both. If your data are paired (the same people measured before and after), a split violin hides that structure. Consider adding lines connecting each subject, or a separate chart of the differences.

Too many categories

Split violins save space, but a row of twelve split violins is still a lot to read. If the categories have a natural order, sort them. If not, consider showing only the most important ones.

Split violin vs side-by-side violins

AspectSplit violinSide-by-side (dodged) violins
Space per categoryOne slotTwo slots
Direct shape comparisonEasy, halves touchHarder, eyes must jump
Works with 3+ hue levelsPoorlyYes
FamiliarityLess familiarMore familiar
Shows full symmetric shapeNo, half onlyYes

For general advice on when a violin is the right chart in the first place, see violin plot vs box plot.

FAQ

What is a split violin plot used for?

It compares two sub-groups within each category by drawing one half-violin for each sub-group back to back. Typical uses are before/after, control/treatment or male/female comparisons.

How do I make a split violin plot in seaborn?

Call sns.violinplot() with a hue variable and split=True. Adding inner="quart" draws quartile lines on each half.

Can a split violin plot have more than two groups?

Since seaborn 0.13, split=True works with more than two hue levels, but a violin only has two sides, so the result is harder to read. Split violins are clearest with exactly two levels.

Why do the two halves of my split violin look the same size when the groups are not?

By default seaborn normalizes each hue level separately, so the halves are not scaled against each other. Use density_norm="count" with common_norm=True to make widths reflect the number of observations, or label each group with its n.

Adrian Lee
Adrian Lee

Adrian Lee is the Data Visualization Specialist and Statistical Analyst at ViolinPlot. Based in Boston, Massachusetts, Adrian utilizes a robust background in statistics and data science to create compelling and insightful visualizations that help interpret complex data.

With extensive experience in data analysis and visualization techniques, Adrian specializes in developing violin plots and other advanced graphical representations to convey statistical information effectively. Adrian’s expertise includes statistical modeling, data interpretation, and the creation of interactive visualizations.

At ViolinPlot, Adrian is responsible for transforming raw data into visual narratives that are both informative and engaging.

By employing state-of-the-art visualization tools and statistical methods, Adrian ensures that the visual representations are accurate, clear, and valuable for decision-making processes.

Adrian’s dedication to enhancing data comprehension through visual tools has established ViolinPlot. As a leading resource for data visualization and statistical analysis.

Articles: 89

Ready to Unlock Deeper Data Insights?

Transform complex datasets into clear, interactive visualizations with Violin Plot. Start exploring data distributions in a way that empowers insight and drives smarter decisions.

LEARN MOre
100% satisfaction guaranteed
McAfee SECURE
ssl-secured
verisign-secured
BEST-PRICE-GUARANTEED-free-trust-badge
guaranteed-safe-checkout-1