shadowText: Shadow a Text

View source: R/shadowText.R

shadowTextR Documentation

Shadow a Text

Description

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

Usage

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

Arguments

x, y

x and y coordinate of text(s) to be shadowed.

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(s)

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)

inSileco/graphicsutils documentation built on Sept. 12, 2022, 11:13 p.m.