# NOT RUN {
plot(NA, xlim = c(0, 100), ylim = c(-10, 10),
xlab = "x", ylab = "y", xaxs = "i", yaxs = "i")
breaks <- 0:200
AddGradientLegend(breaks, GetTolColors, title = "Title", loc = "bottomleft")
AddGradientLegend(breaks, GetTolColors, title = "Title",
loc = "bottomleft", inset = c(0.2, 0.1))
breaks <- seq(0, 2e+06, length.out = 5)
AddGradientLegend(breaks, rainbow, loc = "topright", inset = 0.1)
pal <- function(...) rev(rainbow(...)) # reverse colors in palette
AddGradientLegend(breaks, pal, scientific = TRUE, strip.dim = c(1, 14),
inset = c(0.2, 0.1))
# }
Run the code above in your browser using DataLab