Description Usage Arguments Value Functions Examples
Provides more colorscheme options in addition to basic ones: heat.colors, rainbow and so on. Hot and jet colorschemes are analagous to the MATLAB colorschemes with the same names. Blue and dusk colorschemes correspond to RColorBrewer "Blues" and inverse "RdYlBu".
1 2 3 4 5 6 7 8 9 10 11 | blue.colors(n)
dusk.colors(n)
hot.colors(n)
hot2.colors(n)
jet.colors(n)
jet2.colors(n)
|
n |
Number of different colors in the colorscheme |
Vector of colors as hex RGB strings
blue.colors
: based on RColorBrewer "Blues"
dusk.colors
: based on reverse of RColorBrewer "RdYlBu".
Looks like a dusk.
hot.colors
: based on Matlab's "hot"
hot2.colors
: similar to Matlab's "hot"
jet.colors
: based on Matlab's "jet"
jet2.colors
: similar to Matlab's "jet"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Linear
image(as.matrix(1:100), col=blue.colors(100))
image(as.matrix(1:100), col=dusk.colors(100))
image(as.matrix(1:100), col=hot.colors(100))
image(as.matrix(1:100), col=hot2.colors(100))
image(as.matrix(1:100), col=jet.colors(100))
image(as.matrix(1:100), col=jet2.colors(100))
## Random
N <- 10
set.seed(0)
mat <- matrix(rnorm(N^2), ncol=N)
image(mat, col=blue.colors(N^2))
image(mat, col=dusk.colors(N^2))
image(mat, col=hot.colors(N^2))
image(mat, col=hot2.colors(N^2))
image(mat, col=jet.colors(N^2))
image(mat, col=jet2.colors(N^2))
## Airy pattern
x <- seq(-1,+1,length=100)
z <- outer(x,x,function(x,y){sin(10*sqrt(x^2+y^2))})
image(z, col=blue.colors(100))
image(z, col=dusk.colors(100))
image(z, col=hot.colors(100))
image(z, col=hot2.colors(100))
image(z, col=jet.colors(100))
image(z, col=jet2.colors(100))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.