如何在Seaborn JointPlot上设置标题?

14

为什么会排除这个方法? - lys
1个回答

35

这对我起作用了

p = sns.jointplot(x = 'x_', y = 'y_', data = df, kind="kde")
p.fig.suptitle("Your title here")
p.ax_joint.collections[0].set_alpha(0)
p.fig.tight_layout()
p.fig.subplots_adjust(top=0.95) # Reduce plot to make room 

3
或者,只需使用 plt.suptitle("在此输入您的标题") - Romeo Valentin
4
在调用'JointGrid'对象的suptitle时出现了一个属性错误Attribute Error,所以这个方法没有起作用。为了修复它,需要添加plt.fig.suptitle("Your title here") - Shitij Govil
2
此外,._set_alpha(0) 可能会误导。 - amonk

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接