[R] Format text with outline?

MacQueen, Don macqueen1 at llnl.gov
Tue Jun 19 21:58:29 CEST 2012


I'm using mtext() to annotate a plot. I would like, if possible, to have
the individual characters formatted with an outline or border, with a
contrasting fill color inside the borders.

I'd appreciate suggestions or pointers toward a way to do this.

The reason is because I'm creating a graphic with a transparent background
[png(filename,bg='transparent')] that is to be overlaid on Google Earth.
The background at my location of interest is so varied in color and shape
that it is difficult to find a text color that will reliably have enough
contrast to be legible. Google appears to have dealt with this by using
white text with a black border on each character,and I would like to do
the same, if possible.

I have done some searching, without success so far. Admittedly, this is
well outside the scope of what R is designed for, but, hey, R can do
everything, so why not this?  I did find a possible alternative, the
textrect() function in the RPMG package.

Thanks
-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062



More information about the R-help mailing list