Skip to content
Back to formatted view

Raw Message

Message-ID: <loom.20090302T142804-541@post.gmane.org>
Date: 2009-03-02T14:29:24Z
From: Dieter Menne
Subject: Bold Face in Plot

Rau, Roland <Rau <at> demogr.mpg.de> writes:


> I am trying to plot some text in bold face which works fine:
> 
> plot(0:1,0:1,type="n")
> text(x=0.5, y=0.5, labels=expression(bold("the-actual-string")))
> 
> Now when I try to do the following, the displayed text reads thestring:
> 
> thestring <- "the-actual-string"
> plot(0:1,0:1,type="n")
> text(x=0.5, y=0.5, labels=expression(bold(thestring)))
> 

"expression" can be mind twisting. For a probably more realistic example, 
see the following:

plot(0:1,0:1,type="n")
ss1 = paste("there was ",expression(Delta))
ss = substitute(paste("there was ",expression(Delta)))
text(x=0.3, y=0.3, labels=ss1)
text(x=0.4, y=0.4, labels=ss)


Dieter