将胡须末端放在boxplot上 [英] Put whisker ends on boxplot
问题描述
我想在垂线的末端加上垂线,就像 boxplot
函数自动给出的一样。
正如@Roland暗示但未实现的那样,您可以使用 stat_boxplot
来实现这一点。调用 _boxplot
两次的技巧是将 geom
设置为 errorbar $ c $请注意,因为
R
使用笔和纸的方式,所以建议您使用笔和纸的方式。
df
p> ggplot(df,aes(x = cond,y = value))+
stat_boxplot(geom ='errorbar') +
geom_boxplot()#statistboxbox的缩写(geom ='boxplot')
stat_boxplot
(?stat_boxplot
)详细说明计算出的各种值并保存在 data.frame
I would like to put perpendicular lines at the ends of the whiskers like the boxplot
function automatically gives.
As hinted but not implemented by @Roland, you can use stat_boxplot
to implement this. The trick calling _boxplot
twice and is to set the geom
to errorbar
for one of the calls.
Note that as R
uses a pen and paper approach it is advisable to implement the error bars first the draw the traditional boxplot over the top.
Using @Roland's dummy data df
ggplot(df, aes(x=cond, y = value)) +
stat_boxplot(geom ='errorbar') +
geom_boxplot() # shorthand for stat_boxplot(geom='boxplot')
The help for stat_boxplot
(?stat_boxplot
) detail the various values computed and saved in a data.frame
这篇关于将胡须末端放在boxplot上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!