colorschemes: Favorite Colorschemes

Description Usage Arguments Value Functions Examples

Description

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".

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

Arguments

n

Number of different colors in the colorscheme

Value

Vector of colors as hex RGB strings

Functions

Examples

 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))

vladpetyuk/vp.misc documentation built on June 25, 2021, 6:35 a.m.