This function is a simple wrapper for brewer.pal and colorRampPalette or other colour palette functions that generates pretty colour schemes.

pretty_cols_brewer(
  zlim,
  scheme = "YlOrRd",
  select = 1:8,
  pal = NULL,
  n_breaks = 100,
  rev = FALSE
)

Arguments

zlim

A numeric range that the colour scheme should span.

scheme

A character that defines a colour scheme supported by brewer.pal.

select

An integer vector that defines which colours to draw from the scheme.

pal

A colour palette function. If supplied scheme and select are silently ignored.

n_breaks

The number of breaks in the colour scheme.

rev

A logical value that defines whether or not to reverse sampled colours.

Value

The function returns a named list that contains the z limits (`zlim'), a numeric vector of breaks (`breaks'), the colour palette function (`pal') and the associated vector of colours (`col'). This can be passed to image.plot.

Details

This function is designed to work in conjunction with image.plot.

See also

Author

Edward Lavender