I would like to plot some text in a existing plot graph. Is there a very simple way to do that. It does not need to be pretty at all (just maybe a way to center it or define a position within the plot). ( ? ) Ralf
see ?text Tal ----------------Contact Details:------------------------------------------------------- Contact me: Tal.Galili@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- On Fri, Jul 9, 2010 at 12:52 PM, Ralf B <ralf.bierig@gmail.com> wrote:> I would like to plot some text in a existing plot graph. Is there a > very simple way to do that. It does not need to be pretty at all (just > maybe a way to center it or define a position within the plot). ( ? ) > > Ralf > > ______________________________________________ > 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]]
On 07/09/2010 07:52 PM, Ralf B wrote:> I would like to plot some text in a existing plot graph. Is there a > very simple way to do that. It does not need to be pretty at all (just > maybe a way to center it or define a position within the plot). ( ? ) >Hi Ralf, The "text" function in the graphics package will place text on your plot. It centers the text by default, so that: text(3,4,"my neat\ntwo liner") will place the two lines of text centered at x=3 and y=4. Jim
Others pointed you to the text function for the base graphics system. But if what you want to do is use text, but have a simple way of specifying the center of the plot without computing the user coordinates by hand of the center, then look at the grconvertX and grconvertY functions. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Ralf B > Sent: Friday, July 09, 2010 3:52 AM > To: r-help at r-project.org > Subject: [R] Plotting text in existing plot? > > I would like to plot some text in a existing plot graph. Is there a > very simple way to do that. It does not need to be pretty at all (just > maybe a way to center it or define a position within the plot). ( ? ) > > Ralf > > ______________________________________________ > 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.