Annotating text on individual facet in ggplot2

I want to annotate some text on last facet of the plot with the following code:

library(ggplot2)
p <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
p <- p + facet_grid(. ~ cyl)
p <- p + annotate("text", label = "Test", size = 4, x = 15, y = 5)
print(p)

enter image description here

But this code annotates the text on every facet. How can I get the annotated text on only one facet?

6 Answers
6

Leave a Comment