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 )
zlim | A numeric range that the colour scheme should span. |
---|---|
scheme | A character that defines a colour scheme supported by |
select | An integer vector that defines which colours to draw from the |
pal | A colour palette function. If supplied |
n_breaks | The number of breaks in the colour scheme. |
rev | A logical value that defines whether or not to reverse sampled colours. |
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
.
This function is designed to work in conjunction with image.plot
.
Edward Lavender