Problem
We want to change the width of the error bars in a boxplot created with ggplot2. We use stat_boxplot(geom ='errorbar') to add error bars.
library(ggplot2)
ggplot(iris, aes(factor(Species), Sepal.Width, fill = Species)) +
geom_boxplot() +
stat_boxplot(geom ='errorbar')
Solution
We 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)
No hay comentarios:
Publicar un comentario