How to add a title to Seaborn Facet Plot

How to add a title to this story in Siborn? Let him give the name "I AM TITLE".

tips = sns.load_dataset("tips") g = sns.FacetGrid(tips, col="sex", row="smoker", margin_titles=True) g.map(sns.plt.scatter, "total_bill", "tip") 

plot

+42
python visualization seaborn
Apr 23 '15 at 4:28
source share
4 answers

After these lines:

 plt.subplots_adjust(top=0.9) g.fig.suptitle('THIS IS A TITLE, YOU BET') # can also get the figure from plt.gcf() 

If you add suptitle without adjusting the axis, the labels on the marine facet overlap.

(with different data):

enter image description here

+64
Apr 23 '15 at 5:15
source share

On ipython laptop, this worked for me!

 sns.plt.title('YOUR TITLE HERE') 
+24
Sep 30 '15 at 21:50
source share

What worked for me:

sns.plt.suptitle('YOUR TITLE HERE')

+4
Dec 13 '16 at 16:17
source share
 g.fig.subplots_adjust(top=0.9) g.fig.suptitle('Title', fontsize=16) 

Further information here: http://matplotlib.org/api/figure_api.html

+4
Feb 03 '17 at 17:50
source share



All Articles