pHcolourmap {spatstat.geom}R Documentation

Colour Map for pH Values

Description

Create a colour map for values of pHpH.

Usage

 pHcolourmap(range = c(0, 14), ..., n=256, step = FALSE)
 pHcolour(pH)

Arguments

n

Number of different colour values to be used, when step=FALSE.

range

Range of pHpH values that will be accepted as inputs to the colour map. A numeric vector of length 2 giving the minimum and maximum values of pHpH.

step

Logical value. If step=FALSE (the default) the colours change continuously with increasing values of the input. If step=TRUE, the colour is constant on each unit interval of pHpH values.

...

Ignored.

pH

Numerical value or numeric vector of values of pHpH.

Details

In chemistry the hydrogen potential pHpH measures how acidic or basic a solution is.

The function pHcolour calculates the colour associated with a given value of pHpH, according to a standard mapping in which neutral pH=7pH=7 is green, acidic values pH<7pH < 7 are yellow or red, and basic values pH>7pH > 7 are blue. The function pHcolour takes a numerical value or vector of values of pHpH and returns a character vector containing the corresponding colours.

The function pHcolourmap produces a colour map for numerical values of pHpH, using the same consistent mapping of pHpH values to colours. The argument range specifies the range of pHpH values that will be mapped by the resulting colour map. It should be a numeric vector of length 2 giving the minimum and maximum values of pHpH that the colour map will handle. (Colour maps created with different values of range use essentially the same mapping of colours, but when plotted as colour ribbons, display only the specified range.)

If step=FALSE (the default) the colours change continuously with increasing values of the input. There will be n different colour values in the colour map. Usually n should be a large number.

If step=TRUE, the colour is constant on each unit interval of pHpH values. That is, any value of pHpH in the interval [k,k+1][k, k+1], where kk is an integer, will be mapped to the same colour.

Value

The return value of pHcolour is a character string or a vector of character strings representing colours.

The return value of pHcolourmap is a colour map (object of class "colourmap").

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

See Also

colourmap

Examples

  pHcolour(7)

  plot(pHcolourmap())
  plot(pHcolourmap(step=TRUE))
  plot(pHcolourmap(c(3, 8)))

[Package spatstat.geom version 3.3-2 Index]