[R] expression(alpha) in legend()

Uwe Ligges ligges at statistik.uni-dortmund.de
Thu Jan 3 09:57:56 CET 2002



Tord Snall wrote:

> Dear all,
> I try to plot include expression(alpha) in a legend():
> 
> x<-  seq(0,150)
> par(mfrow=c(1,1))
> matplot(x, outer(x, c(0.001, 0.01, 0.05, 0.1, 0.5),
> function(x, k) exp(-k*x)), type="l", lty=1:5, col=1, lwd=3, ylim=c(0,1), 
> xlim=c(0,170), ylab="", xlab="Distance (m)")
> 
> legend(110, 0.8 , c(expression(alpha), "= 0.001","alpha=0.01","alpha=0.05", 
> "alpha=0.1", "alpha=0.5"), lty=c(1,2,3,4,5), lwd=3, col=1,merge=T)
> 
> I want to replace the text "alpha" with the alpha symbol.



Try

   legend(110, 0.8 , c(
	expression(alpha == 0.001),
	expression(alpha == 0.01),
	expression(alpha == 0.05),
	expression(alpha == 0.1),
	expression(alpha == 0.5)
   ), lty=1:5, lwd=3, col=1, merge=TRUE)


Uwe

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list