Sometimes you want to see every data point, not just a summary. stripplot and swarmplot scatter individual observations across categories — great for small-to-medium datasets.
strip vs swarm
sns.stripplot(data=tips, x="day", y="total_bill", jitter=True) # random jittersns.swarmplot(data=tips, x="day", y="total_bill") # non-overlapping
stripplot adds random horizontal jitter so points don't stack; swarmplot carefully arranges points so none overlap, showing density by width — but it's slow and cluttered for large data.
Overlaying on a box/violin
sns.boxplot(data=tips, x="day", y="total_bill", fill=False)sns.stripplot(data=tips, x="day", y="total_bill", color="black", alpha=0.4)
Key takeaways
- 01stripplot and swarmplot show every individual observation per category.
- 02stripplot uses random jitter; swarmplot arranges points non-overlapping (but is slow on big data).
- 03Overlay a strip/swarm on a box/violin to show summary + raw points.
- 04For large datasets prefer strip with alpha over swarm.
