title: Add annotation or text to individual box plots when using geom_boxplot, facet_grid
body: <p>I am using <code>ggplot2</code> and have constructed a boxplot like so:</p>
  
  <p><img src="https://i.stack.imgur.com/b12Bx.jpg" alt="fruit ggplot"></p>
  
  <p>This was constructed using the following data and code:</p>
  
  <pre><code>structure(list(group = c("C", "C", "C", "C", "C", "C", "C", "C", 
  "C", "C", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "C", 
  "C", "C", "C", "C", "C", "C", "C", "C", "V", "V", "V", "V", "V", 
  "V", "V", "V", "V", "V", "C", "C", "C", "C", "C", "V", "V", "V", 
  "V", "V", "V", "V", "V", "V", "V", "C", "C", "C", "C", "C", "C", 
  "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", 
  "C", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "C", "C", 
  "C", "C", "C", "C", "C", "C", "C", "C", "V", "V", "V", "V", "V", 
  "V", "V", "V", "V", "V", "C", "C", "C", "C", "C", "C", "C", "C", 
  "C", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V"), fruit = c("apple", 
  "apple", "apple", "apple", "apple", "apple", "apple", "apple", 
  "apple", "apple", "apple", "apple", "apple", "apple", "apple", 
  "apple", "apple", "apple", "apple", "apple", "apple", "apple", 
  "apple", "apple", "apple", "apple", "apple", "apple", "apple", 
  "apple", "apple", "apple", "apple", "apple", "apple", "apple", 
  "apple", "apple", "apple", "apple", "apple", "apple", "apple", 
  "apple", "orange", "orange", "orange", "orange", "orange", "orange", 
  "orange", "orange", "orange", "orange", "orange", "orange", "orange", 
  "orange", "orange", "orange", "orange", "orange", "orange", "orange", 
  "orange", "orange", "orange", "orange", "orange", "orange", "orange", 
  "orange", "orange", "orange", "orange", "orange", "orange", "orange", 
  "orange", "orange", "orange", "orange", "orange", "orange", "orange", 
  "orange", "orange", "orange", "orange", "pear", "pear", "pear", 
  "pear", "pear", "pear", "pear", "pear", "pear", "pear", "pear", 
  "pear", "pear", "pear", "pear", "pear", "pear", "pear", "pear", 
  "pear", "pear", "pear", "pear", "pear", "pear", "pear", "pear", 
  "pear", "pear", "pear", "pear", "pear", "pear", "pear"), treatment =  c("pre", 
  "pre", "pre", "pre", "pre", "post", "post", "post", "post", "post", 
  "pre", "pre", "pre", "pre", "pre", "post", "post", "post", "post", 
  "post", "pre", "pre", "pre", "pre", "pre", "post", "post", "post", 
  "post", "pre", "pre", "pre", "pre", "pre", "post", "post", "post", 
  "post", "post", "pre", "pre", "pre", "pre", "pre", "pre", "pre", 
  "pre", "pre", "pre", "post", "post", "post", "post", "post", 
  "pre", "pre", "pre", "pre", "pre", "post", "post", "post", "post", 
  "post", "pre", "pre", "pre", "pre", "pre", "post", "post", "post", 
  "post", "post", "pre", "pre", "pre", "pre", "pre", "post", "post", 
  "post", "post", "post", "pre", "pre", "pre", "pre", "pre", "pre", 
  "pre", "pre", "pre", "pre", "pre", "pre", "pre", "pre", "pre", 
  "post", "post", "post", "post", "post", "pre", "pre", "pre", 
  "pre", "pre", "post", "post", "post", "post", "pre", "pre", "pre", 
  "pre", "pre", "post", "post", "post", "post", "post"), subgroup = c(66, 
  66, 66, 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, 67, 
  67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 
  69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 
  71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 73, 
  73, 73, 73, 73, 73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 
  74, 74, 74, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 77, 77, 77, 
  77, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 
  79, 79, 79, 79, 79, 79, 79, 79, 79, 79), conc = c(0.074, 0.204, 
  0.118, 0.25, 0.159, 0.283, 0.253, 0.436, 0.295, 0.335, 0.204, 
  0.424, 0.254, 0.217, 0.281, 0.153, 0.309, 0.184, 0.341, 0.168, 
  0.14, 0.213, 0.29, 0.266, 0.522, 0.219, 0.34, 0.317, 0.053, 0.196, 
  0.072, 0.185, 0.269, 0.157, 0.344, 0.398, 0.304, 0.173, 0.212, 
  0.197, 0.154, 0.289, 0.212, 0.217, 0.314, 0.337, 0.116, 0.209, 
  0.256, 0.165, 0.216, 0.284, 0.148, 0.151, 0.105, 0.097, 0.201, 
  0.125, 0.208, 0.334, 0.209, 0.269, 0.388, 0.182, 0.12, 0.28, 
  0.253, 0.226, 0.257, 0.193, 0.314, 0.262, 0.12, 0.415, 0.2, 0.209, 
  0.202, 0.08, 0.341, 0.221, 0.598, 0.327, 0.258, 0.655, 0.071,  
  0.209, 0.234, 0.19, 0.117, -0.01, 0.074, 0.038, 0.06, 0.088, 
  0.034, 0.057, 0.099, 0.046, 0.096, 0.166, 0.045, 0.104, 0.08, 
  0.248, 0.031, 0.056, 0.101, 0.077, 0.069, 0.251, 0.585, 0.427, 
  0.145, 0.109, 0.125, 0.079, 0.068, 0.064, 0.184, 0.202, 0.263, 
  0.302, 0.136)), .Names = c("group", "fruit", "treatment", "subgroup", 
  "conc"), row.names = c(NA, -123L), class = "data.frame")
  
  require(ggplot2)
  plot&lt;-ggplot(prot, aes(x=group, y=conc, fill=factor(treatment)))+ 
  geom_boxplot() + 
  scale_fill_manual(values=cbPalette)+
  theme_bw()+
  facet_grid(.~fruit)+    
  labs(fill="treatment status", y="Concentration (mg.ml-1) ") +
  theme(legend.position="bottom", axis.title.y=element_text(size=12, hjust=0.5, vjust=1, face="bold"), axis.text.y=element_text(size=8), axis.title.x=element_text(size=12, hjust=0.5, vjust=0.5, face="bold"), axis.text.x=element_text(size=8))  +
  scale_y_continuous(limits=c(-0.01,0.7), breaks=seq(0,0.7,0.1))
  </code></pre>
  
  <p>I would now like to add small letters e.g. a, b, c above some of the boxplots to denote statistical significance. For example, an "a" above the first box in the first facet and a "b" above the second and third box in the second facet. However, i can only seem to get letters repeated in every facet or all letters in a single facet.</p>
  
  <p>Amongst many other things that didn't work at all, I have come quite close with these attempts:</p>
  
  <pre><code>plot+ annotate("text", label =c("a", "b", "c"), size = 4, x =c(2,1,2), y = c(0.5, 0.3, 0.4))
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>df1&lt;-data.frame(group=c(0.8, 1.2, 1.8, 2.2), conc=c(0.4, 0.4), lab="text", id=factor("apple", levels=c("apple", "orange", "pear")), treatment=factor(2, levels=c("pre", "post")))
  
  plot+ geom_text(data=df1, label=c("a", "b", "a", "d"))
  </code></pre>
  
  <p>I feel I need to specify the facet better somewhere "id=factor("apple".... works if I only want annotation in one facet, but not multiple.</p>