Seaborn Titles


This blogpost provides a few tips and tricks concerning title addition and customization on a chart made with Python and the Seaborn library.

📕 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
sns.set(rc={'figure.figsize':(10,10)})

# Grey background
sns.set(style="darkgrid")

# 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 🎉.

Violin

Density

Histogram

Boxplot

Ridgeline

Contact & Edit

👋 This document is a work by Yan Holtz. Any feedback is highly encouraged. You can fill an issue on Github, drop me a message onTwitter, or send an email pasting yan.holtz.data with gmail.com.

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

Violin

Density

Histogram

Boxplot

Ridgeline

Scatterplot

Heatmap

Correlogram

Bubble

Connected Scatter

2D Density

Barplot

Spider / Radar

Wordcloud

Parallel

Lollipop

Circular Barplot

Treemap

Venn Diagram

Donut

Pie Chart

Dendrogram

Circular Packing

Line chart

Area chart

Stacked Area

Streamgraph

Timeseries with python

Timeseries

Map

Choropleth

Hexbin

Cartogram

Connection

Bubble

Chord Diagram

Network

Sankey

Arc Diagram

Edge Bundling

Colors

Interactivity

Animation with python

Animation

Cheat sheets

Caveats

3D