Description Usage Arguments Value Examples
View source: R/colorpatch_impl.R
This function can be used together with ggplot2 for mapping values onto colorspace::color palettes.
The color is then coerced with coerce.fun
.
1 2 | InterpolateColorFun(pal, xmin = -1, xmax = +1,
coerce.fun = colorspace::hex)
|
pal |
The input palette (must be of class colorspace::color) |
xmin |
minimum of the numeric range to be mapped onto |
xmax |
maximum of the numeric range to be mapped onto |
coerce.fun |
each color will be coerced by this function (defaults to |
A function mapping a numeric value value
onto a color value.
1 2 3 4 5 6 | library(colorspace)
library(colorpatch)
data("OptimGreenRedLAB")
fn <- InterpolateColorFun(OptimGreenRedLAB)
cols <- fn(seq(-1, 1, by = 0.1))
specplot(cols)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.