Ada*_*son 4 python matplotlib seaborn
我正在绘制多个方差分析研究,我希望我的误差条宽度及其上限厚度小于趋势线。绘制带有误差线和上限的三向方差分析时,可能会感觉很拥挤。我当前的情节看起来像这样:
我绘制此图的函数是:
sns.catplot(x="dose", y="somethings", hue="position", kind="point",
palette=sns.xkcd_palette(colors), capsize=.15, data=df, aspect=1.5)
Run Code Online (Sandbox Code Playgroud)
我尝试包含诸如lw_conf
(https://github.com/mwaskom/seaborn/pull/898)之类的关键字,但我不确定在factorplot更改为catplot后它的功能发生了什么。我还尝试了 matplotlib 中的 errorbar 关键字,例如elinewidth
和capthick
。Catplot 似乎将其capsize
作为关键字参数,但我不知道它可能会采用哪些其他关键字或发生了什么lw_conf
。任何有关该关键字可能发生的情况或完成此任务的新方法的反馈将不胜感激。谢谢!
catplot
将额外的 kwargs 传递给底层绘图函数。由于您使用的是kind="point"
,因此绘图功能是sns.pointplot()
。该函数的文档提到了该参数:
errwidth:浮动,可选
误差线(和上限)的粗细。
因此,您只需errwidth=
在调用中包含catplot
:
exercise = sns.load_dataset("exercise")
sns.catplot(x="time", y="pulse", hue="kind", kind="point",
capsize=.15, data=exercise, aspect=1.5, errwidth=0.5)
Run Code Online (Sandbox Code Playgroud)