Description Usage Arguments Details Value History Author(s) See Also Examples
Color palettes for visualization of statistics.
These functions create a vector of n
“contiguous” colors.
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)
|
n |
the number of colors (>= 1) to be in the palette. |
rev |
flag to revert color sequence. |
bias |
gamma correction using power of |
p |
power |
q1, q2, q3, q4 |
cut points |
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.
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
.
svn 0064 renamed igamma
to bias
, as used in colorRamp
.
G. Sawitzki
Palettes
,
colors
, palette
, hsv
,
rgb
, gray
and col2rgb
for
translating to RGB numbers.
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.