Desktop Survival Guide
by Graham Williams

Other Graphic Elements

Place onto a plot text in a rect box with background shading, using strwidth to determine the rectangles coordinates:

text <- "Some Text"; x <- 10; y <- 10
xpad <- 0.1; ypad <- 1.0; bg="wheat"
w <- strwidth(text) + xpad*strwidth(text)
h <- strheight(text) + ypad*strheight(text)
rect(x-w/2, y-h/2, x+w/2, y+h/2, col=bg)
text(x, y, text)

Copyright © 2004-2010 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
The PDF version is a formatted comprehensive draft book (with over 800 pages).
Brought to you by Togaware. This page generated: Sunday, 22 August 2010