[R] Plotting text in existing plot?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Fri Jul 9 12:41:00 CEST 2010


On Fri, Jul 9, 2010 at 11:22 AM, Jim Lemon <jim at bitwrit.com.au> wrote:

> 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.

 BUT it only works on 'base' graphics plots, so if you're using
lattice or ggplot then there's another way to do it. Perhaps.

 Original poster wanted a simple way to do it, but when R has three
graphics systems, four OO systems, and a zillion helpful people
there's never a simple way :)

Barry

-- 
blog: http://geospaced.blogspot.com/
web: http://www.maths.lancs.ac.uk/~rowlings
web: http://www.rowlingson.com/
twitter: http://twitter.com/geospacedman
pics: http://www.flickr.com/photos/spacedman



More information about the R-help mailing list