oceColorsClosure: Create color functions

Description Usage Arguments See Also Examples

View source: R/oce.R

Description

This function generates other functions that are used to specify colors. It is used within oce to create oceColorsTemperature() and its many cousins. Users may also find it helpful, for creating custom color schemes (see “Examples”).

Usage

1

Arguments

spec

Specification of the color scheme. This may be a character string, in which case it must be the name of an item stored in data(ocecolors), or either a 3-column data frame or matrix, in which case the columns specify red, green and blue values (in range from 0 to 1).

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
## Update oxygen color scheme to latest matplotlib value.
library(oce)
oxy <- "https://raw.githubusercontent.com/matplotlib/cmocean/master/cmocean/rgb/oxy-rgb.txt"
oxyrgb <- read.table(oxy, header=FALSE)
oceColorsOxygenUpdated <- oceColorsClosure(oxyrgb)
par(mfrow=c(1, 2))
m <- matrix(1:256)
imagep(m, col=oceColorsOxygen, zlab="oxygen")
imagep(m, col=oceColorsOxygenUpdated, zlab="oxygenUpdated")

## End(Not run)

oce documentation built on Jan. 9, 2022, 1:06 a.m.