colors: Various color palettes

Description Usage Arguments Details Value History Author(s) See Also Examples

Description

Color palettes for visualization of statistics. These functions create a vector of n “contiguous” colors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
green.colors(n=100, rev=FALSE, bias=1.0)
red.colors(n=100, rev=FALSE, bias=1.0)
blue.colors(n=100, rev=FALSE, bias=1.0)

blueyellow.colors(n=100, rev=FALSE, bias=1.0)
blueyellow2.colors(n=100, rev=FALSE, bias=1.0)
blueyellow4.colors(n=100, rev=FALSE, bias=1.0)

greenred.colors(n=100, rev=FALSE, bias=1.0)
greenred2.colors(n=100, rev=FALSE, bias=1.0)
greenred4.colors(n=100, rev=FALSE, bias=1.0)

loggray.colors(n,p=2, rev=FALSE, bias=1.0)

tail.colors(n=100, q1=0.125, q2=0.25, q3=1-q2,q4=1-q1, rev=FALSE)

Arguments

n

the number of colors (>= 1) to be in the palette.

rev

flag to revert color sequence.

bias

gamma correction using power of gamma.

p

power

q1, q2, q3, q4

cut points

Details

Conceptually, all of these functions actually use (parts of) a line defined by a start and an end colour.

At present, to avoid visual artefacts, the blueyellow family is most recommended.

Some palettes come in families. These are variants to reduce the sensory impact of middle values by reducing the saturation. For example, blueyellow2.colors uses a quadratic degradation, blueyellow4.colors a fourth order degradation.

The red, green and blue color palettes provide a range of shades of that colors.

The loggray.colors provide logarithmic gray scales.

The tail.colors is a special facility to mark certain quantiles.

Value

A character vector, cv, of color names. This can be used either to create a user–defined color palette for subsequent graphics by palette(cv), a col= specification in graphics functions or in par.

History

svn 0064 renamed igamma to bias, as used in colorRamp.

Author(s)

G. Sawitzki

See Also

Palettes, colors, palette, hsv, rgb, gray and col2rgb for translating to RGB numbers.

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
29
30
31
32
par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::green.colors(100))
colramp(bertin:::green.colors(100, rev=TRUE))
par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::red.colors(100)); colramp(bertin:::red.colors(100, rev=TRUE))
par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::blue.colors(100)); colramp(bertin:::blue.colors(100, rev=TRUE))

par(mfrow=c(3,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::green.colors(100), bias=0.5)
colramp(bertin:::green.colors(100))
colramp(bertin:::green.colors(100), bias=1.5)

par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::blueyellow.colors(100)); colramp(bertin:::blueyellow.colors(100, rev=TRUE))
par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::blueyellow2.colors(100)); colramp(bertin:::blueyellow2.colors(100,rev=TRUE))
par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::blueyellow4.colors(100)); colramp(bertin:::blueyellow4.colors(100,rev=TRUE))

par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::bluered2.colors(100)); colramp(bertin:::bluered2.colors(100,rev=TRUE))
par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::bluered4.colors(100)); colramp(bertin:::bluered4.colors(100,rev=TRUE))

par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::greenred2.colors(100)); colramp(bertin:::greenred2.colors(100,rev=TRUE))
par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::greenred4.colors(100)); colramp(bertin:::greenred4.colors(100,rev=TRUE))

par(mfrow=c(2,1), mar=c(2, 4, 4, 2) + 0.1)
colramp(bertin:::tail.colors(100)); colramp(bertin:::tail.colors(100,rev=TRUE))

bertin documentation built on May 2, 2019, 5:54 p.m.

Related to colors in bertin...