Learn R Programming

mixOmics (version 4.1-4)

jet.colors: Jet Colors Palette

Description

Create a vector of n "contiguous" colors.

Usage

jet.colors(n)

Arguments

n
an integer, the number of colors $(\geq 1)$ to be in the palette.

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.

encoding

latin1

Details

The function jet.colors(n) create color scheme, beginning with dark blue, ranging through shades of blue, cyan, green, yellow and red, and ending with dark red. This colors palette is suitable for displaying ordered (symmetric) data, with n giving the number of colors desired.

See Also

colorRamp, palette, colors for the vector of built-in "named" colors; hsv, gray, rainbow, terrain.colors, $\ldots$ to construct colors; and heat.colors, topo.colors for images.

Examples

Run this code
## Jet Color Scales Strips
def.par <- par(no.readonly = TRUE)
par(mfrow = c(3, 1))
z <- seq(-1, 1, length = 125)
for (n in c(11, 33, 125)) {
    image(matrix(z, ncol = 1), col = jet.colors(n), 
          xaxt = "n", yaxt = "n", main = paste("n = ", n))
    box()
    par(usr = c(-1, 1, -1, 1))		
    axis(1, at = c(-1, 0, 1))
}
par(def.par)

Run the code above in your browser using DataLab