shadowtext | R Documentation |
Add border to plotted text
shadowtext( x, y = NULL, labels, col = "white", bg = "black", theta = seq(0, 2 * pi, length.out = 50), r = 0.1, ... )
x, y |
numeric vectors of coordinates where the text labels should be written. If the length of x and y differs, the shorter one is recycled. |
labels |
a character vector or expression specifying the text to be written. An attempt is made to coerce other language objects (names and calls) to expressions, and vectors and other classed objects to character vectors by as.character. If labels is longer than x and y, the coordinates are recycled to the length of labels. |
col |
the color of the text. |
bg |
the color of the text border |
theta |
a sequence of angles be which to cycle around the text.
(Default: |
r |
the width of the border (fraction of character width). |
... |
other pars passed to |
lower level plotting command to add text to existing device.
https://stackoverflow.com/a/25632536/1199289
plot(c(0,1), c(0,1), type="n", lwd=20, axes=FALSE, xlab="", ylab="") rect(xleft = 0.5, xright = 1, ybottom = 0, ytop = 1, col=1) text(1/6, 1/6, "Test 1") shadowtext(2/6, 2/6, "Test 2", col='red', bg="blue") shadowtext(3/6, 3/6, "Test 3", cex=2) # `r` controls the width of the border shadowtext(5/6, 5/6, "Test 4", col="black", bg="white", cex=4, r=0.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.