Is there a way to add a horizontal line to a boxplot in ggplot2, that doesn't cut through the existing plot, but only the spaces in between?
Thanks for your help...
Is there a way to add a horizontal line to a boxplot in ggplot2, that doesn't cut through the existing plot, but only the spaces in between?
Thanks for your help...
ggplot adds up each geom one after another, so...
library(ggplot2)
df <- data.frame(x = gl(3,1), y = 1:3)
ggplot(df, aes(x,y)) +
geom_hline(yintercept = 1.5) +
geom_col(width = .5)
... places a horizontal line under the bars produced by geom_col
.