I am not George I am not George - 1 year ago 644
Python Question

How to add a title to Seaborn Facet Plot

How do I add a title to this Seaborne plot? Let's give it a title 'I AM A 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")


Answer Source

After those lines:

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

If you add a suptitle without adjusting the axis, the seaborn facet titles overlap it.

(With different data):

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download