Learn R Programming

tractor.base (version 3.3.3.1)

getColourScale: Obtaining colour scales

Description

The getColourScale function can be used to obtain a standard or customised colour scale for use in the package's image visualisation functions.

Usage

getColourScale(n)

Value

A list with elements

colours

A character-mode vector representing the colours in the scale, usually of length 100. This can be passed as a colour scale to R's plotting functions.

background

A single character string representing the background colour.

Arguments

n

A number, colour name or list (see Details).

Author

Jon Clayden

Details

Colour scales can be specified in any of three ways. Firstly, by a single number, representing a predefined colour scale. Currently valid values are 1 (greyscale, black background), 2 (red to yellow heat scale, red background), 3 (blue to red rainbow scale, blue background), 4 (blue to white to red diverging scale, white background), 5 (white to red, white background), 6 (white to blue, white background), 7 (yellow to orange to red) and 8 (purple to green to yellow, perceptually uniform). Secondly, a single colour name can be given (see colours); in this case the background will be black. This is useful for binary images. Thirdly, and most flexibly, a list with two named elements can be given: colours, a vector of colours representing the colour scale, perhaps created using using the shades package; and background, a single colour representing the background.

References

Please cite the following reference when using TractoR in your work:

J.D. Clayden, S. Muñoz Maniega, A.J. Storkey, M.D. King, M.E. Bastin & C.A. Clark (2011). TractoR: Magnetic resonance imaging and tractography with R. Journal of Statistical Software 44(8):1-18. https://www.jstatsoft.org/v44/i08/.

See Also

colours, rgb, colorRamp, and the shades package for colour manipulation.

Examples

Run this code
getColourScale(1)

Run the code above in your browser using DataLab