Learn R Programming

adegraphics (version 1.0-4)

adeg.panel.label: Panel function for adding labels.

Description

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

Usage

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 th

Value

  • Draws the labels.

item

pos

code

4

References

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

See Also

pointLabel

Examples

Run this code
if(require(lattice, quiet = 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, quiet = 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)})
}

Run the code above in your browser using DataLab