Violin Plots: Aesthetics + Statistics
It's **Day 135**, and we're looking at the **Violin Plot**.
What is a Violin Plot?
A Box Plot only shows 5 numbers (min, max, etc). A Violin Plot shows the **Density** of the data.
# See exactly where the 'Bulk' of the salaries are
sns.violinplot(data=df, x='dept', y='salary')
plt.show()
Why it's better than a Box Plot
If a department has TWO peak groups (e.g., Juniors at $40k and Seniors at $120k), a Box Plot will just show a big rectangle. A Violin Plot will bulge out at the two peaks, looking like a literal violin.
When to use it
Use it for "Exploratory" analysis when you want to see the shape of your data without making 10 different histograms.
Your Task for Today
Swap a `sns.boxplot` for a `sns.violinplot` in your current project and compare the insights.
*Day 136: Interactive Viz with Plotly.*