#52 Custom seaborn violinplot

You can custom some features of seaborn violinplots. Here are 2 examples showing how to change linewidth (left) and general width of each group (right).

# library & dataset
import seaborn as sns
df = sns.load_dataset('iris')

# Change line width
sns.violinplot( x=df["species"], y=df["sepal_length"], linewidth=5)
#sns.plt.show()

# Change width
sns.violinplot( x=df["species"], y=df["sepal_length"], width=0.3)
#sns.plt.show()

Leave a Reply

Your email address will not be published.