Function to create a color key
colorkey(x0, y0, x1, y1, cols = c("white", "steelblue"), tick.range = c(0, 1), tick.marks = seq(tick.range[1], tick.range[2], length.out = 5L), label.from = NULL, label.to = NULL, nlevels = 100, main = NULL, relative = TRUE, tick.args = list(), label.args = list(), main.args = list())
| x0, x1, y0, y1 | Numeric scalars. Coordinates of the lower left and upper right points where the color key will be drawn as proportion of the plotting region. |
|---|---|
| cols | Character scalar. Colors specifications to create the color palette. |
| tick.range, tick.marks | Numeric vectors specifying the range and the tickmarks respectively. |
| label.from, label.to | Character scalar. Labels of the lower and upper values of the color key. |
| nlevels | Integer scalar. Number of levels to extrapolate. |
| main | Character scalar. Title of the colorkey. |
| relative | Logical scalar. When |
| tick.args, label.args, main.args | Lists of arguments passed to graphics::text for drawing ticks, labels and main respectively. |