时间:2022-07-26 10:04:05 | 栏目: | 点击:次
+ theme_bw() +
theme(panel.grid.major=element_line(colour=NA),
panel.background = element_rect(fill = "transparent",colour = NA),
plot.background = element_rect(fill = "transparent",colour = NA),
panel.grid.minor = element_blank())
补充:R语言的ggplot2画图去掉图例的灰色背景
library(ggplot2) ggplot(iris,aes(x=Sepal.Length,y=Sepal.Width))+ geom_point(aes(color=Species))

如果要去掉应该如何实现呢?可以在主题函数里进行设置

library(ggplot2) ggplot(iris,aes(x=Sepal.Length,y=Sepal.Width))+ geom_point(aes(color=Species))+ theme(legend.key = element_blank())
