Re: [R] greek letters, text, and values in labels

From: Charles Annis, P.E. <Charles.Annis_at_statisticalengineering.com>
Date: Wed 26 Jul 2006 - 06:36:21 EST


This'll work.

theta <- 2.1

plot(NA, xlim=c(0,1), ylim=c(0,1), xlab=bquote(theta == .(theta)), ylab=bquote(theta == .(theta)), main=bquote(paste("Results for ",theta == .(theta))))

Charles Annis, P.E.

Charles.Annis@StatisticalEngineering.com phone: 561-352-9699
eFax: 614-455-3265
http://www.StatisticalEngineering.com  

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Adrian Dragulescu Sent: Tuesday, July 25, 2006 4:12 PM
To: r-help@stat.math.ethz.ch
Subject: [R] greek letters, text, and values in labels

Hello,

I want to have a title that will look something like: "Results for \theta=2.1", given that I have a variable theta=2.1, and \theta should show on the screen like the greek letter.

I've tried a lot of things:
theta <- 2.1
plot(1:10, main=expression(paste("Results for", theta, "=", eval(theta))))

or using bquote
plot(1:10, main=paste("Results for ", bquote(theta == .(theta))))

or using substitute, etc. I could not make it work. This should be easy.

I would appreciate your help.

Thanks,
Adrian



R-help@stat.math.ethz.ch 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.

R-help@stat.math.ethz.ch 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. Received on Wed Jul 26 06:41:06 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 26 Jul 2006 - 08:23:59 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.