Put a Color Key on a Plot

USAGE:

color.key(x = 1, y = 0, col = , at = , labels = ,  
          tick.number = 7, space = "right", corner = c(0, 0.5),  
          width = 2, height = 1, plot = T) 

ARGUMENTS:

x, y
location of the key. These coordinates, the corner argument, and the computed size of the color key are all used to determine the location.
col
numeric vector of color numbers used to color the different levels in the color key.
at
numeric vector specifying the values at which the colors change.
labels
a character vector of tick labels marking the value of at. It can also be a self-contained list of components, labels, at , cex, col , and font , describing a customized set of label positions and appearances.
tick.number
number of tick labels desired to label the color key.
space
character string telling which side of the plot the color key is on; values are "top", "bottom" , "left" , and "right" (default).
corner
vector of two fractions that tells which position of the key is referred to by the x,y arguments. For example, corner=c(0,1) means that x,y refers to the upper left of the key.
width
width of the color key in units of character height.
height
length of the key with respect to the length of the side of the plot (based on space ).
plot
logical flag, if FALSE, the color key is not drawn; but the size of the key box, in inches, will be returned.

DETAILS:

color.key is a support function intended to be specified as the colorkey argument for levelplot or wireframe. It is not intended to be called directly; see key instead.

SEE ALSO:

, , .

EXAMPLES:

(see levelplot)