ch_col_gradient function

Creates a colour gradient

Creates a colour gradient

Creates a colour gradient for plotting.

ch_col_gradient( x, colors = c("darkred", "red", "white", "blue", "darkblue"), colsteps = 100, climits = NULL )

Arguments

  • x: Vector of values used for gradient.
  • colors: Vector of colours to form a gradient. Default is c("darkred", "red","white","blue", "darkblue").
  • colsteps: The number of steps in the gradient. Default is 100.
  • climits: Sets specific limits for common scaling.

Returns

  • res: returned array of colour codes

Examples

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)

Author(s)

modified by Paul Whitfield