library(oce)
opar <- par(no.readonly = TRUE)
# 1. Show a few palettes
x <- array(1:1000, dim=c(1,1000))
par(mfrow=c(1,5), mar=c(1, 3, 3, 1))
image(x, col=oce.colorsTwo(200), main="oce.colorsTwo")
image(x, col=oce.colorsJet(200), main="oce.colorsJet")
image(x, col=oce.colorsGebco(200), main="oce.colorsGebco")
image(x, col=oce.colorsPalette(200), main="oce.colorsPalette")
image(x, col=oce.colorsViridis(200), main="oce.colorsViridis")
# 4. Kristen M Thyng's 'cmocean' colours, specialised for oceanography.
par(mfrow=c(3,4), mar=c(1, 3, 3, 1))
image(x, col=oce.colorsCDOM(200), main="oce.colorsCDOM")
image(x, col=oce.colorsChlorophyll(200), main="oce.colorsChlorophyll")
image(x, col=oce.colorsDensity(200), main="oce.colorsDensity")
image(x, col=oce.colorsFreesurface(200), main="oce.colorsFreesurface")
image(x, col=oce.colorsOxygen(200), main="oce.colorsOxygen")
image(x, col=oce.colorsPAR(200), main="oce.colorsPAR")
image(x, col=oce.colorsPhase(200), main="oce.colorsPhase")
image(x, col=oce.colorsSalinity(200), main="oce.colorsSalinity")
image(x, col=oce.colorsTemperature(200), main="oce.colorsTemperature")
image(x, col=oce.colorsTurbidity(200), main="oce.colorsTurbudity")
image(x, col=oce.colorsVelocity(200), main="oce.colorsVelocity")
image(x, col=oce.colorsVorticity(200), main="oce.colorsVorticity")
# 3. Acoustic-Doppler profiler data; note that plot.adp() puts makes
# zlim be symmetric about zero velocity.
par(mfrow=c(1,1))
data(adp)
plot(adp, which='u1')
# 4. Contrast Jet with Viridis, using standard Volcano dataset;
# try printing the results in black and white.
par(mfrow=c(2,1))
imagep(volcano, col=oce.colorsJet)
imagep(volcano, col=oce.colorsViridis)
Run the code above in your browser using DataLab