draw.colorkey: draw.colorkey

View source: R/draw.colorkey.R

draw.colorkeyR Documentation

draw.colorkey

Description

draw.colorkey

Usage

draw.colorkey(key, draw = FALSE, vp = NULL)

draw.colorkey2(key, draw = FALSE, vp = NULL)

Arguments

key

A list determining the key. See documentation for levelplot, in particular the section describing the colorkey argument, for details.

draw

A scalar logical, indicating whether the grob is to be drawn.

vp

The viewport in which to draw the grob, if applicable.

Examples

brks_SOS  <- c(-Inf, seq(110, 150, 5), Inf)
key <- list(
    at = brks_SOS, 
    space = 'right', height = 1,
    tri.upper = 0.05,  tri.lower = 0.05, 
    labels=list(cex=1.2, fontface='bold'), 
    rect = list(col = "black", lwd = 0.2)
)

g <- draw.colorkey(key)
grid.newpage()
grid.draw(g)

## sp
## Not run: 
library(sp)
demo(meuse, ask = FALSE, echo = FALSE)
spplot(meuse, c("ffreq"), col.regions= "black", 
       pch=c(1,2,3), key.space=list(x=0.1,y=.95,corner=c(0,1)))
spplot(meuse.grid)

## End(Not run)

kongdd/latticeGrob documentation built on March 30, 2024, 3:35 a.m.