Learn R Programming

oce (version 1.8-4)

oceColorsCubeHelix: Create Colors in the Cube Helix Style

Description

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.

Author

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

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.

See Also

Other things related to colors: colormap(), colormapGMT(), oceColors9B(), oceColorsCDOM(), oceColorsChlorophyll(), oceColorsClosure(), oceColorsDensity(), oceColorsFreesurface(), oceColorsGebco(), oceColorsJet(), oceColorsOxygen(), oceColorsPAR(), oceColorsPalette(), oceColorsPhase(), oceColorsSalinity(), oceColorsTemperature(), oceColorsTurbidity(), oceColorsTurbo(), oceColorsTwo(), oceColorsVelocity(), oceColorsViridis(), oceColorsVorticity(), ocecolors

Examples

Run this code
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)))

Run the code above in your browser using DataLab