Box Plots and Violin Plots
You'll learn how to compare distributions across categories using box plots and violin plots to reveal both summary statistics and density shapes.
What Are Box and Violin Plots?
When you need to compare how different groups distribute their values—like salary ranges across departments or test scores between classrooms—box plots and violin plots are your go-to tools.
A box plot shows five key numbers: minimum, first quartile (25th percentile), median (50th percentile), third quartile (75th percentile), and maximum. The "box" spans from Q1 to Q3 (the interquartile range), with a line marking the median. Outliers appear as individual points beyond the "whiskers."
A violin plot combines a box plot with a density curve rotated and mirrored on both sides. The width at any point shows how many data points exist at that value—wider means more concentration. Think of it like seeing the "shape" of your data's distribution.
When to Use Each
Use box plots when you want clean, compact comparisons focused on quartiles and outliers. They're excellent for spotting differences in spread and central tendency across groups.
Use violin plots when distribution shape matters—are values clustered in multiple peaks (bimodal)? Is one tail longer than the other (skewed)? Violins reveal these patterns that box plots hide.
The Comparison Advantage
Both plots shine when placed side-by-side across categories. You can instantly see if one group has higher medians, wider spreads, or different distribution shapes than another—something that would take paragraphs to describe from summary statistics alone.
Key Takeaway: Box plots efficiently summarize distributions through quartiles and outliers, while violin plots add density information to reveal the full distribution shape—both excel at comparing multiple groups visually.