How to modify whiskers of a boxplot in ggplot2?

孤人 提交于 2019-12-04 06:45:22

How about plotting two boxplots on top of each other. One with red lines and a second one on top without any wiskers at all.

p + geom_boxplot(color="red") + geom_boxplot(aes(ymin=..lower.., ymax=..upper..)) 

Another option is to plot error bars and on top of them the boxplots without the whiskers:

library(ggplot2)
p + stat_boxplot(geom = "errorbar", colour = "red") + 
  geom_boxplot(coef = 0, outlier.size = 0)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!