Message-ID: <def191ae-83fd-4642-b826-6165cd31a117@s22g2000prg.googlegroups.com>
Date: 2009-03-24T04:20:12Z
From: Andrew
Subject: Legend containing maths symbol and values of variables
In-Reply-To: <42d0a5730903232053t22fb38e6vbb71a3e5359764b2@mail.gmail.com>
the plotmath help page should give the answer
http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/base/html/plotmath.html
On Mar 24, 2:53?pm, Daren Tan <darenta... at gmail.com> wrote:
> 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")
>
> ______________________________________________
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.