Learn R Programming

oce (version 0.2-1)

oceColors: Create a palette of colours

Description

Create a palette of colours

Usage

oceColorsPalette(n, which=1)

oceColorsGebco(n=9, region=c("water", "land", "both"), type=c("fill","line"))

oceColorsJet(n)

oceColorsTwo(n, low=2/3, high=0, smax=1, alpha = 1)

Arguments

n
the number of colors ($\ge 1$) to be in the palette.
which
an identifier for the palette, for oceColorsPalette.
region
the region characteristic, for oceColorsGebco.
type
the type of item drawn, for oceColorsGebco.
low
the hue, in [0,1], for the low end of a oceColorsTwo scale.
high
the hue, in [0,1], for the high end of a oceColorsTwo scale.
smax
the maximum saturation, in [0,1], for the colors of oceColorsTwo.
alpha
the alpha value, in [0,1], for the colors of oceColorsTwo.

Details

oceColorsPalette provides a variety of pre-defined palettes. which=1 yields the ColorBrewer diverging red/blue scheme while which=2 yields the ColorBrewer diverging RYB scheme. (Each is interpolated from the 11-class schemes provided on this site.)

oceColorsGebco provides palettes that mimic the GEBCO altas colours, with shades of blue for water and of brown for land.

oceColorsJet provides a palette similar to the Matlab jet palette.

oceColorsTwo provides a two-tone palette that fades to white at central values.

References

Color Brewer. http://colorbrewer2.org/

Light, A., and P. J. Bartlein, 2004. The End of the Rainbow? Color Schemes for Improved Data Graphics. Eos Trans. AGU, 85(40), doi:10.1029/2004EO400002.

Martin Jakobsson, Ron Macnab, and Members of the Editorial Board, IBCAO. Selective comparisons of GEBCO (1979) and IBCAO (2000) maps. http://www.ngdc.noaa.gov/mgg/bathymetry/arctic/ibcao_gebco_comp.html

Stephenson, David B., 2005. Comment on ``Color schemes for improved data graphics,'' by A. Light and P. J. Bartlein. Eos Trans. AGU, 86(20). (See also http://geography.uoregon.edu/datagraphics/color_scales.htm)

Examples

Run this code
library(oce)
opar <- par(no.readonly = TRUE)
x <- array(1:1000, dim=c(1,1000))
par(mfrow=c(1,4))
image(x, col=oceColorsTwo(100), main="oceColorsTwo")
image(x, col=oceColorsJet(100), main="oceColorsJet")
image(x, col=oceColorsGebco(100), main="oceColorsGebco")
image(x, col=oceColorsPalette(100), main="oceColorsPalette")
par(opar)

Run the code above in your browser using DataLab