I want to add a pair of horizontal lines at the bottom of ggplot to illustrate grouping of the x axis elements. It looks like both geom_abline
and geom_segment
will add lines inside the graph. Any idea how to add lines under it ?
p + geom_segment(aes(x = 2, y = -0.5, xend = 4, yend = -0.5 )) +
geom_segment(aes(x = 5, y = -0.5, xend = 7, yend = -0.5))
this plots the line segment within the plot not under the axis title.
cowplot
can do this, there may be other packages that can too – Jan Boyercowplot
. – PDM