Skip to contents

This is a colour scheme that renders well in black and white, that has colours that are reasonably distinct for many viewers, and that may be good for persons with colour deficiencies. For more on such matters, the underlying theory, and the meanings of the parameter values, please see Green (2011). That R code for the present function is a rewriting of Fortran code provided in an appendix of that paper.

Usage

oceColorsCubeHelix(
  n = 256,
  start = 0.5,
  rotations = -1.5,
  hue = 1.2,
  gamma = 1
)

Arguments

n

number of colors to create, with default 256.

start

numeric value indicating the starting colour. THe default, 0.5, corresponds to purpose, as in Green (2011).

rotations

numeric value for number of rotations of the helix, with default -1.5 as in Green (2011).

hue

numeric value with default 1.2, as in Green (2011).

gamma

numeric value, with default 1.

References

  1. Green, D.A. “A Colour Scheme for the Display of Astronomical Intensity Images.” Bulletin of the Astronomical Society of India, 39 (2011): 289–95.

Author

Dan Kelley based on Fortran code by D.A. Green (2011).

Examples

library(oce)
# Example 1: normal (dark for low values)
imagep(volcano, col = oceColorsCubeHelix)

# Example 2: reversed (dark for high values)
imagep(volcano, col = \(n) rev(oceColorsCubeHelix(n)))