[R] Legend containing maths symbol and values of variables

Daren Tan darentan76 at gmail.com
Tue Mar 24 04:53:32 CET 2009


I need to have the maths symbol for >= in the legend, and to
substitute threshold variable with its value. Somehow, various
attempts weren't successful. Please help.

threshold <- 0.5

plot(NA, xlab="", ylab="", main="", axes=F, xlim=c(0,1), ylim=c(0,1),
xaxs="i", yaxs="i")
legend(x=0, y=1, fill=c("orange", "white", "green", "gray90"),
cex=0.8, pt.cex=1.8, x.intersp=0.6, bg = "white",
           legend=c(expression("Up (" >= threshold ")"), "Normal",
"Down", "NA"), bty = "n")




More information about the R-help mailing list