Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tweak.colourmap

Change Colour Values in a Colour Map


Description

Assign new colour values to some of the entries in a colour map.

Usage

tweak.colourmap(m, col, ..., inputs=NULL, range=NULL)

Arguments

m

A colour map (object of class "colourmap").

inputs

Input values to the colour map, to be assigned new colours. Incompatible with range.

range

Numeric vector of length 2 specifying a range of numerical values which should be assigned a new colour. Incompatible with inputs.

col

Replacement colours for the specified inputs or the specified range of values.

...

Other arguments are ignored.

Details

This function changes the colour map m by assigning new colours to each of the input values specified by inputs, or by assigning a single new colour to the range of input values specified by range.

The modified colour map is returned.

Value

Another colour map (object of class "colourmap").

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

co <- colourmap(rainbow(32), range=c(0,1))
  plot(tweak.colourmap(co, inputs=c(0.5, 0.6), "white"))
  plot(tweak.colourmap(co, range=c(0.5,0.6), "white"))

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.