[R] Plotting text in existing plot?

Jim Lemon jim at bitwrit.com.au
Fri Jul 9 12:22:09 CEST 2010


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



More information about the R-help mailing list