ch_col_gradient {CSHShydRology}R Documentation

Creates a colour gradient

Description

Creates a colour gradient for plotting.

Usage

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.

Value

res

returned array of colour codes

Author(s)

modified by Paul Whitfield

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)

[Package CSHShydRology version 1.4.0 Index]