How to add a title to Seaborn Facet Plot

前端 未结 7 899
不知归路
不知归路 2020-12-07 13:18

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\", r         


        
7条回答
  •  旧巷少年郎
    2020-12-07 14:06

    After those 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 a suptitle without adjusting the axis, the seaborn facet titles overlap it.

    (With different data):

    enter image description here

提交回复
热议问题