【发布时间】:2016-07-26 16:29:19
【问题描述】:
我想使用 seaborn 的 regplot(比相关线更精细)获得精细的误差线。
下面的代码(改编自here)解决了这个问题,但是以一种相当麻烦的方式。有没有更直接的方法来达到这个目的,也许是通过 kws?
with matplotlib.rc_context({"lines.linewidth": 1}):
sns.regplot('A', 'B', data=my_dataframe, x_jitter=10., ci=68, \
ax=ax, x_estimator=np.mean, \
scatter_kws={"s":150}, \
line_kws={"linewidth": 2 })
【问题讨论】:
-
我认为它在
seaborn源代码中是硬连线的。见this line - 它的硬连线是lines.linewidth * 1.75
标签: python matplotlib linear-regression seaborn