我试图在曲线下绘制阴影区域,但是阴影区域在曲线上方。谁能告诉我我的代码有什么问题?
x=seq(0,30)
y1=exp(-0.1*x)
plot(x,y1,type="l",lwd=2,col="chocolate1")
polygon(x,y1, density = 5, angle = 45,col="chocolate1")
答案 0 :(得分:4)
polygon(c(min(x),x),c(min(y1),y1), density = 5, angle = 45,col="chocolate1")