I'm plotting multiple ANOVA studies and I would like my error bar width and their cap thickness to be less than the trend line. When plotting a 3-way ANOVA, with error bars and caps, it can feel crowded. My current plot looks somethings like this:
My function for plotting this is:
sns.catplot(x="dose", y="somethings", hue="position", kind="point",
palette=sns.xkcd_palette(colors), capsize=.15, data=df, aspect=1.5)
I have tried to include keywords such as lw_conf
( https://github.com/mwaskom/seaborn/pull/898 ), but I'm not sure what happened to it's functionality after factorplot was changed to catplot. I have also tried errorbar keywords from matplotlib such as, elinewidth
and capthick
. Catplot seems to take capsize
as a keyword argument but I don't know what other keywords it might take or what happened to lw_conf
. Any feedback about what may have happened to that keyword or a new way of accomplishing this task would be appreciated. Thanks!
catplot
passes extra kwargs to the underlying plotting function. Since you are using kind="point"
, the plotting function is sns.pointplot()
. The documentation for that function mentions the parameter:
errwidth : float, optional
Thickness of error bar lines (and caps).
Therefore you only need to include errwidth=
in your call to 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)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.