[R] Margin annotation

PIKAL Petr petr.pikal at precheza.cz
Mon Oct 22 10:51:58 CEST 2012


Hi

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of David Arnold
> Sent: Monday, October 22, 2012 4:26 AM
> To: r-help at r-project.org
> Subject: [R] Margin annotation
> 
> I have this code:
> 
> x=seq(80-3*15,80+3*15,length=200);
> y=dnorm(x,80,15)
> plot(x,y,type="l",lwd=2,col="red")
> x=seq(80-3*15,70,length=100)
> y=dnorm(x,80,15)
> polygon(c(0,x,70),c(0,y,0),col="gray")
> text(70,0.005,"70")
> 
> I'd like to draw the number "70" in red underneath a vertical arrow
> pointing to the position of the number 70 on the horizontal axis.
> 
> Any ideas?

I am not exactly sure what do you want. 

text(70,0.005,"70", col="red")

put a number 70 in red.

See ?arrows for plotting arrows.
Regards
Petr

> 
> Thanks.
> 
> David.
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Margin-
> annotation-tp4646955.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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.




More information about the R-help mailing list