I am trying to use annotate_custom
to create lines outside of my plot to divide my axis into sections. I am aware of this post that asks a similar question, but for some reason, using a negative value as the min value for the line does not extend the lines outside of the plot.
Sample code:
library(ggplot2)
library(grid)
data("iris")
ggplot(iris, aes(x=Species, y=Petal.Width)) +
geom_bar(stat='identity')+coord_flip()+
annotation_custom(grob = linesGrob(), xmin = 2.5, xmax = 2.5, ymin = -90, ymax = 0)+
annotation_custom(grob = linesGrob(), xmin = 1.5, xmax = 1.5, ymin = -90, ymax = 0)