7
如何更改ggplot2中x轴标签的名称? 见下文:使用ggplot2在R中更改x轴刻度标签
ggbox <- ggplot(buffer, aes(SampledLUL, SOC)) + geom_boxplot()
ggbox <- ggbox + theme(axis.text.x=element_text(color = "black", size=11, angle=30, vjust=.8, hjust=0.8))
ggbox<- ggbox + labs(title = "Land cover Classes") + ylab("SOC (g C/m2/yr)") + xlab("Land cover classes")
上面的代码建立下图:
我想能够capitilize这些类的第一个字母(即作物,相对于裁剪)。
我试过了下面的代码,但不知道放在哪里以及使用哪个函数。 labels = c("Citrus", "Crop", "Cypress Swamp", ..........)
(我使用Windows 7,Rstudio)