How to place annotated text in an empty area of ​​a ggplot face

How to comment text in blank space in an odd numbered grunge ggplot. Allows you to have a faceted ggplot with data, as shown below, with two rows and two columns. Thus, instead of 2 rows, the 2nd column there is an empty space.

  df<- data.frame(Ara = rep("XTX", each = 3),
              Len = c(744, 750, 755),
              Mon = c("Sep", "Oct","Nov"),
              Value=c(11.224,10.15,4.23))
  df
  facetplot<-ggplot(df, aes(x=Value, y=Len, shape=Ara))+
      geom_point(size=5.0)+
      theme(legend.position = c(.7, .4), legend.direction="vertical")+
      facet_wrap(~Mon,scales="free_x", nrow=2)
  facetplot

enter image description here Now I'm trying to annotate some text in space, but I couldn’t (as it is written in red in the image). I am looking for something similar to legend.position for annotated text. Anyone have any ideas on this. Or what will be a possible job. Thank.

+5
source share
2 answers

After creating the plot, simply use

print(facetplot)
grid.text("your text", x = 0.75, y = 0.25)

. ?grid.text. - (0,0) (1,1) .

+9

grid.text, , , ...

grid.text("your text", x = 0.6, y = 0.15, gp = gpar(col="red", fontsize = 20, family = "Times", fontface = "italic"))
0

All Articles