Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100214/4b41a017/attachment.pl>
Try text(.5, .5, bquote(bold(.(myText)))) -Peter Ehlers Mark Heckmann wrote:> # I want to plot bold text. The text should depend on a variable > containing a character string. > > plot.new() > text(.5, .5, expression(bold("Some text"))) > > # now I would like to do the same replacing "some text" by a variable. > > plot.new() > myText <- "some text" > text(.5, .5, expression(bold(myText))) > > # This obviouyls does not work. > # How can I combine substitute, parse, paste etc. do get what I want? > # And could someone add a brief explanation what happens, as I find > parse, expression, deparse, substitute etc. not easy to understand. > > Thanks, > Mark > > ??????????????????????????????????????? > Mark Heckmann > Dipl. Wirt.-Ing. cand. Psych. > Vorstra?e 93 B01 > 28359 Bremen > Blog: www.markheckmann.de > R-Blog: http://ryouready.wordpress.com > > > > > > [[alternative HTML version deleted]] > > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at 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.-- Peter Ehlers University of Calgary
Hi, Try with bquote, plot.new() myText <- "some text" text(.5, .5, bquote(bold(.(myText)))) basically, bquote( .(myText) ) performs the substitution before applying bold() (see ?bquote). HTH, baptiste On 14 February 2010 17:36, Mark Heckmann <mark.heckmann at gmx.de> wrote:> # ?I want to plot bold text. The text should depend on a variable > containing a character string. > > plot.new() > text(.5, .5, expression(bold("Some text"))) > > # now I would like to do the same replacing "some text" by a variable. > > plot.new() > myText <- "some text" > text(.5, .5, expression(bold(myText))) > > # This obviouyls does not work. > # How can I combine substitute, parse, paste etc. do get what I want? > # And could someone add a brief explanation what happens, as I find > parse, expression, deparse, substitute etc. not easy to understand. > > Thanks, > Mark > > ??????????????????????????????????????? > Mark Heckmann > Dipl. Wirt.-Ing. cand. Psych. > Vorstra?e 93 B01 > 28359 Bremen > Blog: www.markheckmann.de > R-Blog: http://ryouready.wordpress.com > > > > > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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. > >
Hi Mark, Try also: plot(1:10) text(2, 5, "Some text", font = 2) HTH, Jorge On Sun, Feb 14, 2010 at 11:36 AM, Mark Heckmann <> wrote:> # I want to plot bold text. The text should depend on a variable > containing a character string. > > plot.new() > text(.5, .5, expression(bold("Some text"))) > > # now I would like to do the same replacing "some text" by a variable. > > plot.new() > myText <- "some text" > text(.5, .5, expression(bold(myText))) > > # This obviouyls does not work. > # How can I combine substitute, parse, paste etc. do get what I want? > # And could someone add a brief explanation what happens, as I find > parse, expression, deparse, substitute etc. not easy to understand. > > Thanks, > Mark > > ––––––––––––––––––––––––––––––––––––––– > Mark Heckmann > Dipl. Wirt.-Ing. cand. Psych. > Vorstraße 93 B01 > 28359 Bremen > Blog: www.markheckmann.de > R-Blog: http://ryouready.wordpress.com > > > > > > [[alternative HTML version deleted]] > > > ______________________________________________ > 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. > >[[alternative HTML version deleted]]
Reasonably Related Threads
- Reordering the results from table(cut()) by break argument
- changing a list element's name during execution in lapply - possible?
- RGtk2 / gWidgets - addHandlerClicked Problem
- gWidgets / RGtk2 - how to change a handler from a toolbar?
- how to flatten a list to the same level?