ggplot2绘图去除背景色及网格线

 

1、

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

 

 

 

 2、去除背景色

p + theme_bw()

 

 

3、去除网格线

p + theme_bw() + theme(panel.grid=element_blank())

 

posted @ 2021-01-10 12:19  小鲨鱼2018  阅读(24223)  评论(0编辑  收藏  举报