get_palette | R Documentation |
From given values, generate colors for plotting.
get_palette() colvec(x)
x |
Vector of values to evaluate. |
get_palette
returns a vector of 99 hex color values. colvec
returns a hex color vector of same length as x
, corresponding to
values of x
.
# generate data x <- y <- seq(-3, 3, length = 30) # color points by numeric values plot(x, y, col=colvec(x), pch=16) # color points by factor values trmt <- gl(3, 10, labels = c('Q', 'R', 'S')) plot(x, y, col=colvec(rev(trmt)), pch=16)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.