I need to find a way to place text 1 inch below the plot. I need that text to be 1 inch below the plot even if I change the margins of the plot or use different data. I’ve been calling grid text with tinkered x and y values, but I want something that will adapt to the dimension of the ggplot. Another approach is to use grobs (see related post) but that would require setting Y positions based on the data.
Here is the basic code:
library(ggplot2)
test= data.frame(
x = c(1:10 ),
y = c(1:10)
)
qplot(x=x, y=y, data=test)+
opts(plot.margin = unit(c(1,3,8,1), "lines")) +
geom_line()
Thanks you.