Description Usage Arguments Examples
HCL version of rainbow
. Create a vector of n
contiguous colours
by specifying a range of Hues, and fixed Chroma and Luminance
1 2 |
n |
number of colours |
c, l |
the ‘chroma’ and ‘luminance’ to be used to complete the HSV color descriptions |
start, end |
the hue in [0,1] at which the rainbow begins/ends |
alpha |
the alpha transparency, a number in [0,1], see argument alpha
in |
s, v |
'saturation' and 'value' passed to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | mat2grid <- function(x) {
eg <- expand.grid(1:NCOL(x), NROW(x):1)
gd <- data.frame(eg, c(t(x)), stringsAsFactors=FALSE)
colnames(gd) <- c("x", "y", "z")
gd
}
n <- 25
hcl0 <- rainbowHCL(n)
hcl1 <- rainbowHCL(n, c=150, l=85)
hcl2 <- rainbowHCL(n, s=1, v=1)
hsv0 <- rainbow(n)
cols <- rbind(hcl0, hcl1, hcl2, hsv0)
pos <- mat2grid(cols)
plot(pos[,1:2], pch=17, cex=3.5, col=pos[,3], ylim=c(0.5, 4.5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.