ggplot2绘图调整x轴、y轴标签及刻度标签的大小


 

1、

p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p

 

 

 

2、调整x轴

p+theme(axis.title.x=element_text(vjust=2, size=20,face = "bold"))

 

 

p+theme(axis.text.x=element_text(vjust=1,size=20,face = "bold"))

 

 

 3、调整y轴

p+theme(axis.title.y=element_text(vjust=2, size=20,face = "bold"))

 

 

p+theme(axis.text.y=element_text(vjust=1,size=20,face = "bold"))

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM