带边缘分布的线性回归#

../_images/regression_marginals.png

使用的 seaborn 组件: set_theme()load_dataset()jointplot()

import seaborn as sns
sns.set_theme(style="darkgrid")

tips = sns.load_dataset("tips")
g = sns.jointplot(x="total_bill", y="tip", data=tips,
                  kind="reg", truncate=False,
                  xlim=(0, 60), ylim=(0, 12),
                  color="m", height=7)