ggplot - 使中位数不可见 geom_boxplot

ggplot - make the median invisible geom_boxplot

出于某些不明确的原因,我必须绘制一个没有明显中值的箱线图。我怎样才能做到这一点(最好使用ggplot,但如果有必要我会切换到boxplot)请问?

相关回答:

一种 "hacky" 方法是在您 post 编辑的答案中使用 fatten 参数,但将其设置为 NULL。请注意,由于您没有 post 任何数据,我使用 mtcars 内置的 R 数据集。这看起来像:

library(ggplot2)
ggplot(data = mtcars) + geom_boxplot(aes(x = as.factor(am), y = hp), fatten = NULL)