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

interp.colourmap

Interpolate smoothly between specified colours


Description

Given a colourmap object which maps numbers to colours, this function interpolates smoothly between the colours, yielding a new colour map.

Usage

interp.colourmap(m, n = 512)

Arguments

m

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

n

Number of colour steps to be created in the new colour map.

Details

Given a colourmap object m, which maps numerical values to colours, this function interpolates the mapping, yielding a new colour map.

This makes it easy to build a colour map that has smooth gradation between different colours or shades. First specify a small vector of numbers x which should be mapped to specific colours y. Use m <- colourmap(y, inputs=x) to create a colourmap that represents this simple mapping. Then apply interp.colourmap(m) to obtain a smooth transition between these points.

Value

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

Author(s)

See Also

Examples

co <- colourmap(inputs=c(0, 0.5, 1), c("black", "red", "white"))
  plot(interp.colourmap(co))

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.