Description Usage Arguments Details Value Examples
Generates a function that calculates a color scale.
1 2 | makeColorFun(xmin, xmax, n = 100, palette = cfd.colors, underflow = NULL,
overflow = NULL)
|
xmin |
Minimum value of the color scale. |
xmax |
Maximim value of the color scale. |
n |
Number of intermediate colors. |
palette |
Color palette used. |
underflow |
Color to use for smaller values, first color if NULL. |
underflow |
Color to use for largerr values, first color if NULL. |
In filled contour plots, a color corresponds to a value. This function creates a new function that given a value, returns the corresponding color. This function can use several different color palettes and can handle values outside the values limits.
Function that returns a color given a numeric value.
1 2 3 4 5 6 7 | fun <- makeColorFun(0, 1, underflow='black', overflow='white')
x <- c(-1, seq(0, 1, len=5), 2)
xcol <- fun(x)
keyWindow(x, xcol)
fun <- makeColorFun(0, 1)
xcol <- fun(x)
keyWindow(x, xcol)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.