[R-sig-Geo] Text label buffering
Greg.Snow at imail.org
Thu Jun 23 21:22:54 CEST 2011
Look at the shadowtext function in the TeachingDemos package.
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-
> project.org] On Behalf Of Matthew Vavrek
> Sent: Thursday, June 23, 2011 12:11 PM
> To: r-sig-geo at r-project.org
> Subject: [R-sig-Geo] Text label buffering
> Hello all,
> I'm making up some maps in R, but some of the labels are being obscured
> by other lines on the map. I'd like to be able to buffer my labels, so
> that there's a bit of whitespace surrounding each letter to make them
> more readable. I've tried doing this by doing a double call to text(),
> with white in bold (font=2) and then a regular font, and by adjusting
> the text size, but the text doesn't really match up between the two
> labels this way.
> for example:
> text(0.5, 0.5, label='text', col='white', font=2, cex=3)
> text(0.5, 0.5, label='text', col='black', font=1, cex=3)
> text(0.5, 0.5, label='text', col='white', cex=3)
> text(0.5, 0.5, label='text', col='black', cex=2.9)
> give the idea of what I want, but not quite as cleanly as I'd like.
> Is there some way of doing this? Seems like there should be, but
> searching the internets hasn't turned up anything yet.
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
More information about the R-sig-Geo