Python Violin plot Gallery | Dozens of examples with code

🔎 violinplot() function parameters→ see full doc

→ Description

The violinplot() function of seaborn creates violin plots which show the distribution of quantitative data across several levels of one (or more) categorical variables. It combines a box plot with a kernel density estimation.

→ Arguments

Description

Inputs for plotting long-form data. This parameter specify the variable for the x axes.

Possible values → string, vector, or pd.Series

Can be vector names in the data DataFrame, or external vectors passed directly.

Code Example

# Library & Dataset
import seaborn as sns
import matplotlib.pyplot as plt
tips = sns.load_dataset("tips")

# Plot
sns.violinplot(x="total_bill", data=tips)
plt.show()

Matplotlib logoBest 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!