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)