How to make `seaborn.violinplot` `boxplot` `showfliers`?
Oct 13, 8:55am

seaborn.violinplot doesn't expose a showfliers option — the inner box (inner="box") draws the box and whiskers, but never the outlier markers. You have two practical workarounds:

Option 1: Overlay a hidden boxplot that only shows fliers

python
import seaborn as sns
import matplotlib.pyplot as plt

df = sns.load_dataset("tips")
order = ["Thur", "Fri", "Sat", "Sun"]

ax = sns.violinplot(data=df, x="day", y="total_bill", inner="box", order=order)

# overlay an invisible boxplot that only renders its outliers
data = [df.loc[df["day"] == d, "total_bill"] for d in order]
ax.boxplot(
    data,
    positions=range(len(order)),
    widths=0.05,
    showbox=False, showwhiskers=False, showcaps=False, showmedians=False,
    flierprops=dict(marker="o", markerfacecolor="none", markersize=5),
)
plt.show()

Since both matplotlib and seaborn define outliers as points beyond 1.5 × IQR, the fliers land exactly where the violin's whiskers end.

Option 2: Show all raw points instead

python
ax = sns.violinplot(data=df, x="day", y="total_bill", inner="point", order=order)

or use inner="stick". This shows every observation (outliers included) rather than just boxplot-style fliers.

If you literally want a visible boxplot with fliers inside the violin, just overlay a narrow, semi-transparent one:

python
ax = sns.violinplot(data=df, x="day", y="total_bill", inner=None, order=order)
sns.boxplot(data=df, x="day", y="total_bill", order=order,
            width=0.15, boxprops=dict(alpha=0.5), fliersize=3, ax=ax)

Option 1 is the closest equivalent of showfliers=True for violins; Option 3 is the common "raincloud-style" combo plot.

Oct 13, 8:55am

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more