How can I add a line onto each bar in a ggplot barplot?
For example, using the built-in ggplot example:
mm <- ddply(mtcars, "cyl", summarise, mmpg = mean(mpg))
ggplot(mm, aes(x = factor(cyl), y = mmpg)) + geom_bar(stat = "identity")
produces this
Now I have a vector y <- c(10, 5, 5), which is the height at which I want to plot a line on each bar, producing something like this
How can I do it? I tried geom_hline, but that produces lines that cut across the entire chart instead.


