1

In the current version of ggplot2, the middle line in a box-whisker-plot is drawn bold compared to the other lines:

library(ggplot2)
p <- ggplot(mtcars, aes(factor(cyl), mpg))
p + geom_boxplot()

I think this was not the case in some older versions. Is there a way to separately adjust the width of the middle line?

AnjaM
  • 2,941
  • 8
  • 39
  • 62

1 Answers1

9

Poorly documented, but you can use the fatten argument in geom_boxplot

library(ggplot2)
p <- ggplot(mtcars, aes(factor(cyl), mpg))
p + geom_boxplot(fatten = 0)

enter image description here

p + geom_boxplot(fatten = 4)

enter image description here

Henrik
  • 65,555
  • 14
  • 143
  • 159