Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How to Add a overall Title to Seaborn Plots

Add overall title to seaborn using suptitle() method
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

# create pandas DataFrame
df = pd.DataFrame({'wins': [12, 11, 10, 3, 11, 20, 2, 30, 12,7],
                   'lost': [6, 4, 5, 3, 10, 7, 2, 12, 0, 6],
                   'team': ['A', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'B']})

# plot the data frame
rel = sns.relplot(data=df, x='wins', y='lost', col='team')

# add overall title
rel.fig.suptitle('ICC World Cup Standings')
plt.show()
Source by itsmycode.com #
 
PREVIOUS NEXT
Tagged: #How #Add #Title #Seaborn #Plots
ADD COMMENT
Topic
Name
6+1 =