我喜欢这种特殊的情节,并且喜欢将函数传递给stat_func关键字的功能,以快速地绘制和可视化变量之间的关系,但是我喜欢一件事。如何“关闭”或不绘制边际分布轴?
看起来不错,但有时我不想要此功能。
例如,使用以下代码:
import numpy as np
import seaborn as sns
x = (np.arange(100) + np.random.randn(100)*20
y = (np.arange(100) + np.random.randn(100)*20
sns.jointplot(x, y, kind='reg')
如何删除主轴顶部和右侧的kde子图?
您可以JointGrid
直接使用:
from scipy import stats
g = sns.JointGrid(x, y, ratio=100)
g.plot_joint(sns.regplot)
g.annotate(stats.pearsonr)
g.ax_marg_x.set_axis_off()
g.ax_marg_y.set_axis_off()
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句