📕 Add a title

The following distribution chart is built thanks to the kdeplot() function of seaborn.

This function returns a matplotlib axes instance. Unlike pyplot itself, which has a method plt.title(), the corresponding argument for an axes is ax.set_title(). This is what you need to call to build the title:

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

# Figure size

# Grey background

# Make default density plot
ax = sns.kdeplot(df['sepal_width'])

# Add title
ax.set_title('A distribution chart made with Seaborn');

🎨 Title customization

Once you've understood how to add a title to a seaborn chart, customization works the same as for matplotlib. Visit this blopost to see many customization examples 🎉.

Contact & Edit

👋 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! 🔥

This page is just a jupyter notebook, you can edit it here. Please help me making this website better 🙏!