rainbowPalette: Perceptually optimised rainbow colors

View source: R/rainbowPalette.R

rainbowPaletteR Documentation

Perceptually optimised rainbow colors

Description

This function returns a perceptually optimised rainbow color palette.

Usage

rainbowPalette(n)

Arguments

n

the number of colours to be returned

Value

a vector of colours

Examples

pal <- function(col, border = "transparent", ...) {
  n <- length(col)
  plot(0, 0, type="n", xlim = c(0, 1), ylim = c(0, 1),
       axes = FALSE, xlab = "", ylab = "", ...)
  rect(0:(n-1)/n, 0, 1:n/n, 1, col = col, border = border)
} # courtesy Paul Murrell

pal(rainbowPalette(1000))


environmentalinformatics-marburg/Rsenal documentation built on July 28, 2023, 6:09 a.m.