我喜欢这个特定的绘图以及将函数传递给 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()
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)