I am using ggplot2 for box ploting.
However, I can't change the width of stat_boxplot (geom ='errorbar').
Here is part of my code:
geom_boxplot(width=0.5)+stat_boxplot(geom ='errorbar',width=0.5)
It's OK for geom_boxplot()
, but the width of stat_boxplot(geom ='errorbar')
is not changed .
Any suggestions? Thank you!
To resize the whiskers lines (width) we can use the argument stat_params = list(width = 0.5)
inside the function: stat_boxplot
library(ggplot2)
ggplot(iris, aes(factor(Species), Sepal.Width, fill = Species)) +
geom_boxplot() +
stat_boxplot(geom ='errorbar', stat_params = list(width = 0.5)) +
Update
Now we can use the argument width
inside stat_boxplot
library(ggplot2)
ggplot(iris, aes(factor(Species), Sepal.Width, fill = Species)) +
geom_boxplot() +
stat_boxplot(geom ='errorbar', width = 0.5)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With