Learn R Programming

spatstat.geom (version 3.7-0)

default.colourmap: Default Colour Map for Plotting a Spatial Pattern

Description

Determines a colour map for plotting a spatial pattern (or other data) when one is not supplied by the user.

Usage

default.colourmap(x, ...,
                  col=spatstat.options("image.colfun"),
                  scramble.cols=FALSE,
                  monochrome=spatstat.options("monochrome"))

Arguments

Value

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

Details

In the spatstat package, an object of class "colourmap" defines a mapping between data and colours.

The function default.colourmap provides a suitable default colour map for the values in x.

If x is a factor, default.colourmap(x) is a mapping from the factor levels to colours. If x is a logical vector, default.colourmap(x) is a mapping from the values TRUE and FALSE to colours. If x is a numeric vector, default.colourmap(x) is a mapping from numbers in the interval between the minimum and maximum values of x to colours.

The argument col may provide colour information in any of the following formats:

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

  • A palette function (a function(n) or function(n, ...) which returns a vector of colour values, such as rainbow

  • A vector of integers between 1 and 8 indexing the standard colour palette

  • A vector of character strings giving common names of colours (e.g. "red")

  • A vector of character strings giving hexadecimal codes for colours (e.g. produced by rgb or rainbow)

  • NULL.

See Also

colourmap

Examples

Run this code
  default.colourmap(letters[1:4])
  default.colourmap(factor(letters[1:3], levels=letters[1:4]))
  default.colourmap(TRUE)
  default.colourmap(NULL)

Run the code above in your browser using DataLab