我想结合下面的lmplot。更具体地说,红线是每个季节的平均值,我想将它们与其他数据放到各自的lmplot上,而不是将它们分开。这是我的代码(请注意,轴限制无效,因为第二个lmplot将其弄乱了。当我仅绘制初始数据时,它就可以工作):
ax = sns.lmplot(data=data, x='air_yards', y='cpoe',col='season', lowess = True, scatter_kws={'alpha':.6, 'color': '#4F2E84'}, line_kws={'alpha':.6, 'color': '#4F2E84'})
ax = sns.lmplot(data=avg, x='air_yards', y= 'cpoe',lowess=True, scatter=False, line_kws={'linestyle':'--', 'color': 'red'}, col = 'season')
axes.set_xlim([-5,30])
axes.set_ylim([-25,25])
ax.set(xlabel='air yards')
And here is the output. Simply put, I want to take those red lines and put them on their respective year plots above. Thanks!