restrict.colourmap: Restrict a Colour Map to a Subset of Values

View source: R/colourtables.R

restrict.colourmapR Documentation

Restrict a Colour Map to a Subset of Values

Description

Given a colour map defined on a range of numerical values or a set of discrete inputs, the command restricts the range of values to a narrower range, or restricts the set of inputs to a subset, and returns the associated colour map.

Usage

restrict.colourmap(x, ..., range = NULL, breaks = NULL, inputs = NULL)

Arguments

x

Colour map (object of class "colourmap").

...

Ignored.

range

New, restricted range of numerical values to which the colour map will apply. A numeric vector of length 2 giving the minimum and maximum values of the input. Incompatible with breaks and inputs.

breaks

Vector of breakpoints for the new colour map. A numeric vector with increasing entries. Incompatible with range and inputs.

inputs

Values accepted as inputs for the new colour map. A factor or vector. Incompatible with breaks and range.

Details

This command produces a new colour map y which is consistent with the original colour map x, except that y is defined on a narrower interval of numeric values, or a smaller set of discrete input values, than x.

Value

Colour map (object of class "colourmap").

Author(s)

\adrian

.

See Also

colourmap

Examples

  plot(a <- colourmap(topo.colors(128), range=c(-1,1)))
  plot(b <- restrict.colourmap(a, range=c(0,1)))

spatstat.geom documentation built on Oct. 20, 2023, 9:06 a.m.