Learn R Programming

plotfunctions (version 1.4)

get_palette: Retrieve the color scheme for contour plots.

Description

Retrieve the color scheme for contour plots.

Usage

get_palette(color, nCol = 50, col = NULL)

Arguments

color

A string, or vector of strings, indicating a color palette. Includes: 'topo', 'heat', 'bwr', 'cm', 'terrain', 'bpy', 'gray', 'bw', or user defined colors.

nCol

The number of colors to use in color schemes.

col

Color of contour lines for the contour plots. If NULL (default), a color is determined, depending on the color palette.

Value

Color palette.

See Also

plotsurface, gradientLegend

Other Utility functions: findAbsMin(), find_n_neighbors(), firstLetterCap(), getArrowPos(), getDec(), getRange(), getRatioCoords(), group_sort(), inch2coords(), isColor(), list2str(), move_n_point(), orderBoxplot(), se(), sortGroups()

Examples

Run this code
# NOT RUN {
pal <- get_palette('terrain', nCol=10)
names(pal)
image(matrix(1:10, ncol=10), col=pal$color, axes=FALSE)
# user defined color palette:
pal <- get_palette(c('green', 'orange', 'red'))
image(matrix(1:10, ncol=10), col=pal$color, axes=FALSE)

# }

Run the code above in your browser using DataLab