On Aug 17, 2010, at 11:51 AM, Kay Cichini wrote:


hello,

i need to annotate a plot with an expression and a variable value - like:

plot(1:4)
dat<-1:2
text(2:3,2:3,expression(paste(bar(x)==dat)))


... but with the dat values plotted, 1 at x=2,y=2, and 2 at x=3,y=3.

One way ... actually the first success after several earlier failed efforts that I thought should have worked :

plot(1:4)
dat<-1:2
text(2:3,2:3,labels=sapply(dat,
function(x) as.expression(substitute(list(bar("x") == x), list(x=x) )) ))

--

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@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.

Reply via email to