r - 在ggplot中删除geom_smooth层
问题描述
我通过此代码在单个图中绘制了不同变量的时间图:
landu<-getField(source =landuseh,var = "LU", cover.threshold = 0.01, spatial.extent = mountains, spatial.extent.id = "SEA" )
year<-selectYears(x = landu, first = 1750, last = 2100)
datalu<-as.data.frame(yearssel1)
aggregate1<-aggregateSpatial(yearssel1)
print(aggregate1)
p<-plotTemporal(aggregate1,layers=c("CL","PA", "NA"))
上面的代码是通过 R 中的 DGVMTools 包完成的。
plot2<-p+theme_classic()+labs(y= "Fraction", x = "Year")+
ggtitle("",subtitle ="")+guides(color=guide_legend(override.aes=list(fill=NA)))+
theme(legend.title = element_blank())+
theme(legend.position = "bottom", text = element_text(size = theme_get()$text$size * 1.2))+
theme(panel.background = element_rect(colour = "black", size=1))
geom_smooth 是自动绘制的(我从来没有通过命令来绘制它)。我的 ggplot 层是:
plot2$layers
[[1]]
geom_smooth: se = TRUE, na.rm = FALSE, orientation = NA, flipped_aes = FALSE
stat_smooth: method = lm, formula = y ~ x, se = TRUE, n = 80, fullrange = FALSE, level = 0.95, na.rm = FALSE, orientation = NA, method.args = list(), span = 0.75
position_identity
[[2]]
geom_line: na.rm = FALSE, orientation = NA, flipped_aes = FALSE
stat_identity: na.rm = FALSE
position_identity
如何删除几何平滑线?并且只保留几何平滑阴影后面的那些线条?
解决方案
推荐阅读
- macos - 如何在不显示仪表板的情况下在 MacOS 上使用 cli 命令启动 docker 桌面?
- python - **StreamExecutor 设备 (0):Tensorflow 中的主机,默认版本**
- javascript - JS/Electron 逐项添加
- php - PHP邮件服务器故障
- python - 对于许多列,找到最大绝对值的有效方法
- c++ - 如何从父类调用子函数
- python - NumPy:将 1D 数组转换并重塑为 2D 数组,用零?
- c++ - 片段着色器的输出并不总是正确显示(下面有很多细节)(找到解决方案)
- html - 有没有办法在加载时将 div 的水平滚动位置设置为中间?
- python - 根据下一个值更新熊猫数据框