大佬帮我看看,这个想自动保存怎么才能成功啊,一直在报错
Error in UseMethod("grid.draw") :
no applicable method for 'grid.draw' applied to an object of class "list"
下面是代码:
p<-plot.gam(gam_model温度, shift = intercept3, shade=T,
select=1, xlab='Temperature(℃)', ylab=expression(bold(paste(NH[3],"(μg/m"^3*")"))),#)sep = "")
family = "serif",font=1,cex.axis=2,cex.lab=2,font.lab=2,
xlim=c(0,45),
ylim=c(0,16), font.main=2,
#residuals=T,是否显示源点
cex = .7, pch=1, bty="o",se=T,
)
p
abline(v=c(29),
col=c("#E10600FF"),
lty=c(2,1), lwd=c(3, 3))
text(c(30), 2.5, c("N=8760,F=156.3 ,P<2e-16"),cex=1.5,font=1,col="red",family = "serif")
ggsave(p,filename="C:/Users/HP/Documents/福建师范大学/大论文/R/图/温度相关图.png")
Error in UseMethod("grid.draw") :
no applicable method for 'grid.draw' applied to an object of class "list"
下面是代码:
p<-plot.gam(gam_model温度, shift = intercept3, shade=T,
select=1, xlab='Temperature(℃)', ylab=expression(bold(paste(NH[3],"(μg/m"^3*")"))),#)sep = "")
family = "serif",font=1,cex.axis=2,cex.lab=2,font.lab=2,
xlim=c(0,45),
ylim=c(0,16), font.main=2,
#residuals=T,是否显示源点
cex = .7, pch=1, bty="o",se=T,
)
p
abline(v=c(29),
col=c("#E10600FF"),
lty=c(2,1), lwd=c(3, 3))
text(c(30), 2.5, c("N=8760,F=156.3 ,P<2e-16"),cex=1.5,font=1,col="red",family = "serif")
ggsave(p,filename="C:/Users/HP/Documents/福建师范大学/大论文/R/图/温度相关图.png")