Adding title using suptitle method

suptitle method takes a string which is title of plot as parameter.

Syntax

fig.suptitle(‘Title of plot’)

Example:

Python3




# import necessary packages
import pandas as pd
import seaborn as sns
  
# create a dataframe
temperature = pd.DataFrame({'Month': ['Jan', 'Feb', 'Mar',
                                      'Apr', 'May', 'Jun',
                                      'Jul', 'Aug', 'Sep',
                                      'Oct', 'Nov', 'Dec'],
                            'Avg_Temperatures': [22, 25, 28,
                                                 32, 35, 44
                                                 38, 32, 25
                                                 23, 20, 18]})
  
# plot a rel-plot
plot = sns.relplot(x='Month', y='Avg_Temperatures', data=temperature)
  
# add title using suptitle
plot.fig.suptitle('Monthly Avg Temperatures')


Output

How to Add a Title to Seaborn Plots?

In this article, we will discuss how to add a title to Seaborn Plots in Python.

Similar Reads

Method 1: Adding title using set method

set method takes 1 argument “title” as a parameter which stores Title of a plot....

Method 2: Adding title using suptitle method

...

Method 3: Adding title using set_title

suptitle method takes a string which is title of plot as parameter....

Contact Us