# Draw onto a 1*1 drawing surface
ggdraw() + draw_text("Hello World!", x = 0.5, y = 0.5)
#
# Adorn a plot from the Anscombe data set of "identical" data.
library(ggplot2)
p <- ggplot(anscombe, aes(x1, y1)) + geom_point() + geom_smooth()
three_strings <- c("Hello World!", "to be or not to be", "over and out")
p + draw_text(three_strings, x = 8:10, y = 5:7, hjust = 0)
Run the code above in your browser using DataLab