Violin plot
A violint plot allows you to visualize the distribution of a numeric variable for one or several groups. Seaborn
is particularly adapted to build it thanks to its violin()
function. Violin plots deserve more attention than boxplots, which can sometimes hide features of the data.
⏱ Quick start
Seaborn
is definitely the best library to quickly build a violin plot. It offers a dedicated violinplot()
function that roughly works as follows:🔥
# library & dataset
import seaborn as sns
df = sns.load_dataset('iris')
# plot
sns.violinplot(x=df["species"], y=df["sepal_length"])
Violin charts with Seaborn
Seaborn
is a python library that enables you to make better visualizations. It is well adapted to build density charts thanks to its violin
function. The following charts will guide you through its usage, going from a very basic violin plot to something much more customized.
Best python violin chart examples
The web is full of astonishing charts made by awesome bloggers, (often using R). The Python graph gallery tries to display (or translate from R) some of the best creations and explain how their source code works. If you want to display your work here, please drop me a word or even better, submit a Pull Request!
Contact
👋 This document is a work by Yan Holtz. You can contribute on github, send me a feedback on twitter or subscribe to the newsletter to know when new examples are published! 🔥