[R] text display using expression or not

Mark Difford mark_difford at yahoo.co.uk
Fri Jun 15 21:41:08 CEST 2007


Hi Sarah,

You will kick yourself (perhaps?).  Try:

?par   ## sub: font.main (& font, just above)

## Example
par(mfrow=c(2,1))
plot(1:10, 1:10, main="Figure A", font.main=1)
plot(1:10, 1:10, main=expression("Figure B"))

Regards,
Mark.


Sarah Goslee wrote:
> 
> Hello,
> 
> I imagine that I'm missing something straightforward, but a run thru
> the help files didn't turn up an answer.
> 
> I noticed while formatting some figures for publication that text
> enclosed in expression() and used for a title displays differently
> than a string, regardless of the par options. On both postscript()
> and x11() devices, the regular text is heavier than the expression text.
> 
> Here's an example. The "real thing" used expression() to
> produce superscripts, but I boiled this down to the simplest possible
> case.
> 
> par(mfrow=c(2,1))
> plot(1:10, 1:10, main="Figure A")
> plot(1:10, 1:10, main=expression("Figure B"))
> 
> Is there some straightforward way to make them match, other
> than putting expression() around all strings?
> 
> 
> I'm currently using R 2.5.0 on Fedora core 5.
> 
> Thanks,
> Sarah
> 
> -- 
> Sarah Goslee
> http://www.functionaldiversity.org
> 
> ______________________________________________
> R-help at 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/text-display-using-expression-or-not-tf3929372.html#a11146488
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list