View source: R/Scale_colorPalette.R
scale_colorPalette | R Documentation |
This function is a wrapper of color interpolation colorRampPalette
,
which takes an color palettes function
and re-scale palettes in square root, 4th root and log scales.
scale_colorPalette(col_fun = jet.colors, scale = "2nd")
col_fun |
A Color Palettes function |
scale |
A character string of "2nd", "4th" and "log" to rescale the color palettes indicated by col_fun |
returns a function that takes an integer argument (the required number of colors) and returns a character vector of colors (see rgb
) interpolating the given sequence (similar to heat.colors
or terrain.colors
.
Chih-Lin Wei <chihlinwei@gmail.com>
log.colors <- scale_colorPalette(heat.colors, "log")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.