[R] graphs

Poersching Poersching79 at web.de
Sun Jul 26 07:48:48 CEST 2009


Mary A. Marion schrieb:
> Hello,
>
> I am plotting two distributions and want to draw a vertical line at
> the critical point 149.
> How can I stop it from going further up than the norm(140,15) curve?
>
> x<-seq(75,225,0.1)
> plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy')
> abline(v = 149, col = "black")
> curve(dnorm(x,mean=150, sd=15),from=75, to=225, col='orange', add=TRUE)
>
> Thank you.
>
> Sincerely,
> Mary A. Marion
>
> ______________________________________________
> R-help at 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.
>
Hey,
in your case you shouldn't use the abline command. Instead try segment like:
segments(149, 0, 149, dnorm(149,mean=140, sd=15))

Regards,
Christian Porsche

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090726/3924612e/attachment-0002.bin>


More information about the R-help mailing list