breaks.grid: Define breakpoints for colour scales

View source: R/breaks.grid.R

breaks.gridR Documentation

Define breakpoints for colour scales

Description

This function can be used to define breakpoints for use with the functions draw.grid and legend.grid

Usage

breaks.grid(grd, quantile = 0.975, ncol = 12, zero = TRUE)

Arguments

grd

an array produced by make.grid or a list produced by make.multigrid or a vector of positive values.

quantile

the maximum value of the breaks will be determined by the quantile given here. This can be used to deal with outlying values in grd. If quantile = 1 then the maximum value of the breaks will be the same as the maximum value in grd.

ncol

number of colours to be used, always one more than the number of breakpoints. Defaults to 12.

zero

logical, should zero be included as a separate category? Defaults to TRUE.

Value

a vector of breakpoints to be used by draw.grid and legend.grid

Author(s)

Hans Gerritsen

See Also

draw.grid, legend.grid

Examples

breaks.grid(100,ncol=6)
breaks.grid(100,ncol=5,zero=FALSE)

# create breaks on the log scale
exp(breaks.grid(log(10000),ncol=4,zero=FALSE))

mapplots documentation built on Aug. 25, 2023, 5:15 p.m.