Eric J Ma's Website

Boxplot or Violin Plot?

written by Eric J. Ma on 2016-09-27 | tags: data visualization data science

The same data, different visualizations.

Here's the box plot version:

Data plotted using Seaborn's box plot.

And here's the violin plot version.

Data plotted using Seaborn's violin plot.

Which is more appropriate, and why?

I think the Box Plot is more suited for clearly delineating ranges: (min, max), (IQR), and medians, whereas the Violin Plot is more suited for visualizing the distribution of data, including the possibility of bi-/multi-modality.

I send out a newsletter with tips and tools for data scientists. Come check it out at Substack.

If you would like to sponsor the coffee that goes into making my posts, please consider GitHub Sponsors!

Finally, I do free 30-minute GenAI strategy calls for organizations who are seeking guidance on how to best leverage this technology. Consider booking a call on Calendly if you're interested!