rainbowPalette: Perceptually optimised rainbow colors

Description Usage Arguments Value Examples

View source: R/rainbowPalette.R

Description

This function returns a perceptually optimised rainbow color palette.

Usage

1

Arguments

n

the number of colours to be returned

Value

a vector of colours

Examples

1
2
3
4
5
6
7
8
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 Sept. 23, 2018, 5:17 a.m.