I am trying to plot a shaded area under a curve but however the shaded area is over the curve. Can anyone tell me what's wrong with my code?
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")