Reputation: 180
My question addresses the second solution given to this question : locate title in top left of grid.arrange.
I would like to put the title on the top left corner of an marrangeGrob
, but also align it vertically with the left limit of the plot.
Is there a way to do this automatically: without finding by try and error the proper value for the x
argument of the textGrob
?
Upvotes: 1
Views: 148
Reputation: 56219
Maybe add the title for left plot only:
library(ggplot2)
library(gridExtra)
p1 <- qplot(1:20) + ggtitle("Title")
p2 <- qplot(30, 35) + ggtitle("")
grid.arrange(p1, p2, nrow = 1)
Upvotes: 2