change thickness of the whole line geom_boxplot()
Asked Answered
B

2

47

I would like to increase the boldness of the entire boxplot to be more visible on the hard copy. from Here seems "fatten" parameter change the thickness of the only median line. Is there any other parameter that control the thickness/width of the the whole box plot ?

require(reshape)
require(ggplot2)
cars_melt = melt(cars)

ggplot(aes(x = variable, y = value), data = cars_melt) + 
  geom_boxplot(fatten = 2) 
Brader answered 2/5, 2014 at 17:30 Comment(4)
geom_boxplot(lwd=3) ("lwd" for "line width"). Also, if lwd makes the median too thick, you can use lwd and fatten together to make the median line thinner relative to the other lines.Ryurik
omg ! probably because it was that easy, nobody has asked this question before !Brader
I'm not sure anything about R is easy the first time around.Ryurik
@Ryurik Might as well add that as an answer, no?Alikee
R
62

Use geom_boxplot(lwd=3) ("lwd" for "line width"). Also, if lwd makes the median too thick, you can use lwd and fatten together to make the median line thinner relative to the other lines.

Ryurik answered 14/5, 2014 at 6:26 Comment(0)
A
6

Just a note from the future, 2023... it is now geom_boxplot(linewidth = 3)

Ancalin answered 30/8, 2023 at 5:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.