View source: R/ch_col_gradient.R
| ch_col_gradient | R Documentation | 
Creates a colour gradient for plotting.
ch_col_gradient(
  x,
  colors = c("darkred", "red", "white", "blue", "darkblue"),
  colsteps = 100,
  climits = NULL
)
| x | Vector of values used for gradient. | 
| colors | Vector of colours to form a gradient. Default is  | 
| colsteps | The number of steps in the gradient. Default is  | 
| climits | Sets specific limits for common scaling. | 
| res | returned array of colour codes | 
modified by Paul Whitfield
plot(rnorm(20),col='black')
# create a red blue colour gradient for plotting
mycol <- ch_col_gradient(rnorm(20), colsteps = 100)
# plot more random points in transparent blue colour
points(rnorm(20), col = mycol)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.