Thanks a lot for your help! Now I have a related problem, that I still can not solve:
I plot a t distribution using: curve(dt(x, df = 20), xlim=c(-5,5)) The upper 5% of that distribution using: qt(0.05, df=20, lower.tail=FALSE) How can define the polygon to highlight the area representing the upper 5% of values? Thanks a lot! Georg "Ken Knoblauch" <[EMAIL PROTECTED]> writes: > How about, > > d<-density(rnorm(10000)) > plot(d) > wvs <- which(d$x > 1 & d$x < 2) > polygon(d$x[c( wvs[1], wvs, wvs[length(wvs)] ) ], c(0, d$y[wvs], 0), col = > "bisque") > > Georg Otto a écrit: > Hi, > > if I plot a normal distribution like this: > > d<-density(rnorm(10000)) > plot(d) > > how can I highlight the area below the graph in a certain interval, > say x=1,2? I understand that I should use polygon, but I have not > found the right way to give the result that I want. > > . ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
