基本上我想在圖表下面記下我的發現,例如「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