开发者

plot the *shaded* region under *y=sin(x)* in R

开发者 https://www.devze.com 2023-01-29 07:23 出处:网络
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?

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")
0

精彩评论

暂无评论...
验证码 换一张
取 消