Here is one way: thestring <- "the-actual-string" plot(0:1,0:1,type="n") text(x=0.5, y=0.5, labels=bquote(bold(.(thestring))))
There is an example in the plotmath help page that shows using bquote (but that page has so much information that I did not find it on my first scan through even knowing what to look for). Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Rau, Roland > Sent: Monday, March 02, 2009 6:46 AM > To: r-help@r-project.org > Subject: [R] Bold Face in Plot > > Dear all, > > 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))) > > Can someone tell me what I am doing wrong? I assume it is rather simple > but I am stuck somehow. > > Thanks in advance, > Roland > > P.S. I tried it using ("ancient") R 2.7.0 on Windows32 and version > 2.8.1 > on GNU/Linux (Ubuntu 8.10). > > ---------- > This mail has been sent through the MPI for Demographic Research. > Should you receive a mail that is apparently from a MPI user without > this text displayed, then the address has most likely been faked. If > you are uncertain about the validity of this message, please check the > mail header or ask your system administrator for assistance. > > ______________________________________________ > 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. ______________________________________________ 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.