[R] Format text with outline?

baptiste auguie baptiste.auguie at googlemail.com
Tue Jun 19 22:11:20 CEST 2012


Have a look at this:

http://stackoverflow.com/questions/7734535/control-font-thickness-without-changing-font-size

and

http://stackoverflow.com/questions/10686054/outlined-text-with-ggplot2
which refers to a base graphics version.

HTH,

b.

On 20 June 2012 07:58, MacQueen, Don <macqueen1 at llnl.gov> wrote:
> 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
>
> ______________________________________________
> 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.



More information about the R-help mailing list