2
x轴考虑简单的例子:注释文本使用GGPLOT2
library(ggplot2)
head(mtcars)
# create the plot
ggplot(mtcars, aes(factor(cyl))) + geom_bar() + theme_bw() +
theme(strip.text.x = element_text(size = 20, face="bold"))+
xlab("number of cyl") + ylab("Count")
现在我们可以得到平均$mpg
每cyl
有:
aggregate(mpg ~ cyl, data = mtcars, FUN=mean)
我怎样才能把这些平均值为X以使它们出现在对应的cyl
之下。一个可以绘制表格,不知怎么写,这是每缸的......平均MPG ...
也许这会有所帮助:http://stackoverflow.com/questions/16680063/how-can-i-add-a-table-to-my-ggplot2-output – beetroot
是否有使用特定的原因'facet_grid'代替'ggtitle()'在剧情上放置一个标题?这可能会给潜在的答案增加不必要的复杂性。 – Uwe
不,让我们删除它 – user08041991