[R] Legend

P Ehlers ehlers at math.ucalgary.ca
Wed Sep 26 12:06:54 CEST 2007


How about

a <- .33
b <- .55
legend("bottom", fill=c("red","blue"),
   legend=c(bquote(p == .(a)), bquote(p == .(b))), bty="n")

or look at ?substitute

  - Peter Ehlers

stat stat wrote:
> I have following syntax for putting a legend :
> 
> legend("bottom", fill=c("red","blue"), legend=expression(p==0.30, p==0.50), bty="n")
> 
> However what I want is that : the value "0.30" should be a value of a variable instead of a constant, so that I can put the name of this variable and in legend it's value will be displayed. Can anyone tell me how to do that?
> 
> Regards,
> 
> 
> thanks in advance
>        
> ---------------------------------
>  Why delete messages? Unlimited storage is just a click away.
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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