imageText.Color: Adds text to the last plot

Description Usage Arguments Author(s) See Also Examples

Description

Adds text to the last plot.

Usage

1
2
## S3 method for class 'Color'
imageText(this, label=c("none", "index", "rgb", "space"), col=NULL, cex=0.6, srt=0, ...)

Arguments

label

Type of labels to add (a character string).

col

Color for text.

cex

Scale factor (a numeric) for the text.

srt

String rotation (a numeric).

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

See Also

For more information see Color.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# One-dimensional colors
ncolors <- 256/4
x <- seq(0,1, length=ncolors)

layout(matrix(1:4, ncol=2, byrow=TRUE))
opar <- par(mar=c(0,1,3,1)+0.5)

color <- RainbowColor(x);
for (label in c("index", "rgb", "space")) {
  image(color, gridLty=1, gridLwd=3)
  imageText(color, label=label, cex=1)
}

par(opar)

HenrikBengtsson/R.colors documentation built on May 6, 2019, 11:53 p.m.