#32 Custom boxplot appearance | seaborn

This post aims to describe 3 customizations you can apply to your seaborn boxplot:

Custom line width

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

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

Add notch

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

# Add notch
sns.boxplot( x=df["species"], y=df["sepal_length"], notch=True)
#sns.plt.show()

Control box sizes

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

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

Leave a Reply

Your email address will not be published.