I want to add an annotation outside the plotting area in a faceted ggplot. I can get the annotation that I want, but it's repeated for each facet. How can I get this annotation to appear only once?
E.g., to annotate "XX" once in the top left hand corner I can use:
library("ggplot2")
ggplot(mtcars, aes(x = hp, y = mpg)) +
geom_point() +
facet_grid(.~cyl ) +
annotate("text", x = -20, y = 36, label = "XX") +
coord_cartesian(xlim = c(50, 350), ylim = c(10, 35), clip = "off")
However this actually annotates it to the top left of each facet.
How can I get this to only appear once?
See Question&Answers more detail:os