plot the *shaded* region under *y=sin(x)* in R
I would like to plot the shaded region between y=sin(x) and y=开发者_运维知识库0 over x in [0, pi] in R. Can you give some examples?
By shaded, I mean the region can be colored and better be half-transparent.
Thanks and regards!
see ?polygon :
x <- seq(0,pi,length.out=100)
y <- sin(x)
plot(x,y,type="l")
polygon(x,y,col="grey")
精彩评论