adeg.panel.label: Panel function for adding labels. In adegraphics: An S4 Lattice-Based Package for the Representation of Multivariate Data

Description

Panel function for drawing labels into a trellis graphic (lattice package) with or without boxes around labels.

Usage

 1 adeg.panel.label(x, y, labels, plabels, pos = NULL)

Arguments

 x a numeric vector, x-coordinates for the labels y a numeric vector, y-coordinates for the labels labels a vector of character string, the labels plabels a list of parameters as an extract of adegpar("plabels"), used for labels' drawing. Each value can be a vector and will be recycled if necessary: alpha, cex, col: drawing parameters for the text srt: orientation of the labels, horizontal, vertical or an angle indication (in degrees). Boxes are not rotated. If the orientation is not near to horizontal/vertical (0/90), it is best not to draw the boxes optim: logical. If TRUE, uses an algorithm trying to avoid labels' overlapping and outside limits boxes: concerns the label's boxes. a list: draw: logical. If TRUE, labels are framed alpha, border, col, lwd, lty: rule transparency, border lines and background color pos a position specifier for the text, used in panel.text. Values of 1, 2, 3 and 4 respectively indicate positions below, to the left of, above and to the right of the specified coordinates.

Value

Draws the labels.

Author(s)

Alice Julien-Laferriere, Aurelie Siberchicot [email protected] and Stephane Dray

References

The algorithm used for labels positions optimization is inspired by the pointLabel function of the maptools package developed by Tom Short.

pointLabel

Examples

 1 2 3 4 5 6 7 8 9 10 11 12 if(require(lattice, quietly = TRUE)) { param <- adegpar("plabels")[[1]] xyplot(1:10 ~ 1:10, panel = function(x, y, ...){ adeg.panel.label(x, y, LETTERS[1:10], plabels = param)}) } if(require(lattice, quietly = TRUE)) { param\$boxes\$draw <- FALSE param\$col <- "blue" xyplot(1:10 ~ 1:10, panel = function(x, y, ...){ adeg.panel.label(x, y, LETTERS[1:10], plabels = param)}) }

Example output

adegraphics documentation built on Sept. 1, 2018, 1:05 a.m.