R 语言geom_smooth() 改颜色

我想把这个背景改成和下图一样的

img

这是我的代码 用到的package 是 tidyverse
ggplot(iris,aes(x=Sepal.Length,y=Sepal.Width))+

geom_point(aes(color = Species))+
scale_color_manual(values = c("orange","green","navy"))+
facet_grid(cols = vars(Species))+
geom_smooth()+
theme_bw()

这是我的代码生成的图片

img

在ggplot函数的aes添加两个参数:col=Species,fill=Species就行了,修改代码如下:

library(ggplot2)
p<-ggplot(iris,aes(x=Sepal.Length,y=Sepal.Width,col=Species,fill=Species))+
geom_point(aes(color = Species))+
scale_color_manual(values = c("orange","green","navy"))+
facet_grid(cols = vars(Species))+
geom_smooth()+
theme_bw( )
plot(p)