除去盒须须中的胡须 [英] Remove whiskers in box-whisker-plot

查看:147
本文介绍了除去盒须须中的胡须的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

g > 中的 ggplot2 中,有没有一种直接的方法可以将胡须从胡须中移除?

MWE:

 <$ c $ 
p < - ggplot(mtcars,aes(factor(cyl),mpg))
p + geom_boxplot(outlier.size = 0)


解决方案

我们只需要添加参数 coef = 0 p < - ggplot(mtcars,aes(factor(cyl) ,
+ geom_boxplot(outlier.size = 0,coef = 0)


Is there a straightforward way to remove the whiskers from a box-whisker-plot in ggplot2 in R? I'd like to keep only the boxes themselves.

MWE:

library("ggplot2")
p <- ggplot(mtcars, aes(factor(cyl), mpg))
p + geom_boxplot(outlier.size = 0)

解决方案

We only need to add the argument coef = 0:

library(ggplot2)
p <- ggplot(mtcars, aes(factor(cyl), mpg))
p + geom_boxplot(outlier.size = 0, coef = 0)

这篇关于除去盒须须中的胡须的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆