Skip to contents

Optimize the location of text labels to minimize overplotting text.

Usage

label(
  x,
  y = NULL,
  labels = seq_along(x$x),
  type = c("text", "shadow", "box"),
  ...
)

Arguments

x, y

A numeric vector giving the x and y coordinates of a set of points. If y is NULL, an attempt is made to interpret x in a suitable way (see grDevices::xy.coords()).

labels

A character vector or expression specifying the text to be written.

type

A character string specifying the shape of the field. It must be one of "text", "shadow" or "box". Any unambiguous substring can be given.

...

Further arguments to be passed to graphics::text(), particularly, character expansion, cex and color, col.

Value

label() is called it for its side-effects: it results in a graphic being displayed.

Note

This function is modeled after car::pointLabel() (originally from the maptools package).

See also

Author

N. Frerebeau