基本上我想在图表下面记下我的发现,例如“2000年到2006年间,病例增加了28%”。如何在图表的底部添加注释?
我已经尝试过使用annotation_custom,但在facet_grid的情况下,它将它放在图上的每个面之下,而不是完全在图之外。我也尝试在其他搜索上使用网格编排,但没有文字甚至出现在我能看到的任何地方。
library(ggplot2)
...
graph <- ggplot(data=dataSource, aes(x=factor(year), y=Cases, fill = type))
graph <- graph+geom_bar(stat="identity")+facet_grid(.~type)
graph <- graph+labs(title="Some title here", x="Year", y="Cases by county", fill="Type")
print(graph)
代码重复性。见[mcve]。 –
在'ggplot2'的github版本中,在'labs()'中有一个新的'caption'选项, – hrbrmstr