Hello, I have this code to plot a certain normal distribution and represent the pnorm value for a certain "x":
x<-300 xx <- seq(2.5,7.5, by=0.1) yy <- dnorm(xx,5.01,0.77) d<-signif(pnorm(log(x), 5.01,0.77),4) xpts <- round(exp(0:8)) par(bg = "antiquewhite") plot(xx,yy, type="l", col="blue", lwd=2, xaxt="n", xlab=expression(ufc/m^3), ylab="Densidad") axis(1, at=log(xpts, base=exp(1)), lab=xpts) n<-0 for (i in 1:(dnorm(log(x), 5.01,0.77)/0.005)){ n<-n+0.005 points(log(x), n, pch=16, cex=0.3)} points(log(x),-0.01,pch=24,cex=2,bg='RED') text(log(x)+0.4, 0.004, paste(d*100, "%")) I'd like to colour the area under the curve left to my "x". Is there any way? Thanks in advance _____________________ David Hervás Marín [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.