使用ggplot2更改R中的x轴刻度标签
如何更改ggplot2中x轴标签的名称? 见下文:使用ggplot2更改R中的x轴刻度标签,r,ggplot2,boxplot,R,Ggplot2,Boxplot,如何更改ggplot2中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 = &quo
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")
ggbox创建标签:
SoilSciGuylabs <- c("Citrus", "Crop", "Cypress Swamp")
请注意,str\u to\u句
可用于生成所需的大写方案。
+ scale_x_discrete(labels= SoilSciGuylabs)