將腳註添加到使用ggplot2創建的情節底部的最佳方法是什麼?我已經使用邏輯的組合注意到這裏試圖http://www.r-bloggers.com/r-good-practice-%E2%80%93-adding-footnotes-to-graphics/還有GGPLOT2註釋功能ggplot2腳註
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)))
,但我得到的as.data.frame.default錯誤「錯誤(X [我] ,optional = TRUE,stringsAsFactors = stringsAsFactors):不能強制類c(「unit.arithmetic」,「unit」)到data.frame中。
如果您在R中查看繪圖,但它看起來不像ggsave功能,則此功能可行。 – user338714 2010-06-14 18:18:14
然後打開一個合適的圖形設備,而不是使用'ggsave()',例如'pdf(「filename.pdf」,width = 10,height = 6);打印(P); grid.text(...); dev.off()' – rcs 2010-06-14 18:37:41