View source: R/spectrumcolors.R
spectrumcolors | R Documentation |
Generates smooth rainbow color scale from red to purple, similar to rainbow
, but with improved smoothness
spectrumcolors(n, alpha = 1, rev = FALSE)
n |
integer number of colors in the scale |
alpha |
alpha transparency value (0=fully transparent, 1=fully opaque) |
rev |
logical flag indicating whether the ordering of the colors should be reversed |
Returns an n-vector of RGB colour strings.
Danail Obreschkow
#' @examples nplot() rasterImage(rbind(spectrumcolors(1e3)),0,0,1,0.5) rasterImage(rbind(rainbow(1e3,end=5/6)),0,0.5,1,1) text(0.5,0.25,'spectrum') text(0.5,0.75,'rainbow') abline(h=0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.