This function shadows a text and adds it to an existing plot.

shadowText(x, y, labels, col = "white", bg = par()$fg, radius = 0.1, ...)

Arguments

x

coordinate(s) of text(s) on the x-axis.

y

coordinate(s) of text(s) on the y-axis.

labels

A character vector to shadow.

col

color of the text.

bg

color of the background (shadow color).

radius

Width of the shadow.

...

others parameters to pass to text().

Author

Nicolas CASAJUS, nicolas.casajus@gmail.com

Examples

plot(1, type = "n", ann = FALSE, las = 1)
shadowText(x = 0.7, y = 1.3, labels = "This is a\nshadow text")
shadowText(x = 1.0, y = 1.3, labels = "This is a\nshadow text", family = "serif")
shadowText(x = 1.3, y = 1.3, labels = "This is a\nshadow text", family = "mono")
shadowText(x = 1.0, y = 1.0, labels = "This is a shadow text", family = "serif", cex = 3, col = "yellow", bg = "red")
shadowText(x = 0.7, y = 0.7, labels = "This is a\nshadow text", family = "serif", srt = 45)
shadowText(x = 1.0, y = 0.7, labels = "This is a\nshadow text", family = "serif", srt = 180)
shadowText(x = 1.3, y = 0.7, labels = "This is a\nshadow text", family = "serif", srt = -45)