A violinplot combines a box plot with a KDE: the width at each point shows how many observations are there. It reveals the shape a box plot hides — including multiple peaks.
violinplot
sns.violinplot(data=tips, x="day", y="total_bill")# split=True mirrors two hue groups on each violin — compact comparisonsns.violinplot(data=tips, x="day", y="total_bill", hue="sex", split=True)
Key takeaways
- 01violinplot shows distribution shape (a mirrored KDE) plus box-plot summary.
- 02Its width encodes density — it reveals multiple peaks a box hides.
- 03split=True mirrors two hue groups on one violin for compact comparison.
- 04Being KDE-based, it can over-smooth very small groups.
