ggplot2 footnote

Posted by user338714 on Stack Overflow See other posts from Stack Overflow or by user338714
Published on 2010-06-14T17:33:50Z Indexed on 2010/06/14 18:42 UTC
Read the original article Hit count: 289

Filed under:
|

What is the best way to add a footnote to the bottom of a plot created with ggplot2? I've tried using a combination of the logic noted here http://www.r-bloggers.com/r-good-practice-%E2%80%93-adding-footnotes-to-graphics/ as well as the ggplot2 annotate function

p + annotate("text",label="Footnote",
  x=unit(1,"npc") - unit(2, "mm"),y=unit(2, "mm"),
  just=c("right", "bottom"),gp=gpar(cex= 0.7, col=grey(.5)))

but I am getting the error "Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class c("unit.arithmetic", "unit") into a data.frame".

© Stack Overflow or respective owner

Related posts about r

    Related posts about ggplot2