rp.colour.key {rpanel} | R Documentation |
Creates a colour key.
Description
A colour key is created using the specified colours (cols
) and an axis defined by the specified breaks (brks
). This is usually an additional component of a panel which allows the colours on the main plot to be interpreted. The function is used in that way in the function rp.plot4d
.
Usage
rp.colour.key(cols, brks, par.mar = c(5, 0, 4, 3) + 0.1, natural = TRUE, margin = FALSE)
Arguments
cols |
a vector of colours. |
brks |
a vector of values which defines the positions on the axis between which each colour is placed. |
par.mar |
a vector of four values which are passed to the |
natural |
a logical value which, when |
margin |
a logical value which determines whether a marginal plotting area is placed on the left of the key. This can be useful in allowing relevant information to be plotted alongside the key, such as the confidence intervals in |
References
rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.
Examples
## Not run:
key.plot <- function(panel) {
rp.colour.key(topo.colors(12), 0:12)
panel
}
panel <- rp.control()
rp.tkrplot(panel, key, key.plot, hscale = 0.15)
## End(Not run)