pretty_cols_brewer: Create pretty colour schemes

View source: R/pretty_cols.R

pretty_cols_brewerR Documentation

Create pretty colour schemes

Description

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

Usage

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

Arguments

zlim

A numeric range that the colour scheme should span.

buffer

A logical input that defines whether or not to 'buffer' breaks along zlim at either end by the difference between sequential breaks.

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 (but see buffer).

rev

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

Details

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

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.

Author(s)

Edward Lavender

See Also

pretty_cols_split_heat


edwardlavender/prettyGraphics documentation built on Jan. 19, 2025, 2:47 p.m.