在R中使用dnorm和多边形函数绘制图形

在R中使用dnorm和多边形函数绘制图形,r,graphics,visualization,probability,normal-distribution,R,Graphics,Visualization,Probability,Normal Distribution,我用..找到了概率 pnorm(176, 135, 10, lower.tail=TRUE) - pnorm(146, 135, 10, lower.tail=TRUE) 结果为0.1356,约14% 我必须使用dnorm和polygon函数来创建一个图形,其中显示正态分布中的着色区域(基于上面的百分比) 有人知道怎么做吗?类似这样的事情: library(ggplot2) x=seq(80,190,1) dat = data.frame(x, dens=dnorm(x,135,10))

我用..找到了概率

pnorm(176, 135, 10, lower.tail=TRUE) - pnorm(146, 135, 10, lower.tail=TRUE)
结果为0.1356,约14%

我必须使用dnorm和polygon函数来创建一个图形,其中显示正态分布中的着色区域(基于上面的百分比)

有人知道怎么做吗?

类似这样的事情:

library(ggplot2)

x=seq(80,190,1)
dat = data.frame(x, dens=dnorm(x,135,10))

ggplot(dat, aes(x,dens)) +
  geom_line() +
  geom_area(data=dat[dat$x >= 146 & dat$x <= 176,], 
            fill="red")
库(ggplot2)
x=序号(80190,1)
dat=数据帧(x,dens=dnorm(x,135,10))
ggplot(数据、aes(x、密度))+
geom_线()+
geom_面积(数据=dat[dat$x>=146&dat$x