| SpectrumLegend {TreeTools} | R Documentation |
Prints an annotated vertical bar coloured according to a continuous palette.
SpectrumLegend( x0 = 0.05, y0 = 0.05, x1 = x0, y1 = y0 + 0.2, absolute = FALSE, legend = character(0), palette, lwd = 4, lty = 1, lend = "square", pos = 4, ... )
x0, y0, x1, y1 |
Coordinates of the bottom-left and top-right end of the bar. |
absolute |
Logical specifying whether |
legend |
Character vector with which to label points on |
palette |
Colour palette to depict. |
lwd, lty, lend |
Additional parameters to |
pos, ... |
Additional parameters to |
This convenience function is not yet very customizable; do file a GitHub issue if you would value additional functionality.
Martin R. Smith (martin.smith@durham.ac.uk)
plot(0:1, 0:1, type = "n", frame.plot = FALSE,
xlab = "x", ylab = "y")
SpectrumLegend(legend = c("Dark", "Middle", "Bright"),
palette = hcl.colors(32L), lwd = 5)
SpectrumLegend(0.4, 0.95, 0.9, 0.95, abs = TRUE,
legend = seq(1, 9, by = 2), palette = 1:9, pos = 1)