Learn R Programming

oce (version 1.4-0)

oceColorsViridis: Create colors similar to the matlab Viridis scheme

Description

This is patterned on a matlab/python scheme (reference 1) that blends from yellow to blue in a way that is designed to reproduce well in black-and-white, and to be interpretable by those with certain forms of color blindness (references 3-4). An alternative to this is provide in the viridis package, as illustrated in Example 2.

Usage

oceColorsViridis(n)

Arguments

n

number of colors to create.

References

  1. A blog item on the Viridis (and related) matplotlib color scales is at http://bids.github.io/colormap/.

  2. 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.

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

  4. 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

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

Examples

Run this code
# NOT RUN {
library(oce)
# Example 1: oceColorsViridis
imagep(volcano, col=oceColorsViridis(128),
       zlab="oceColorsViridis")
# Example 2: viridis::viridis
# }
# NOT RUN {
imagep(volcano, col=viridis::viridis,
       zlab="viridis::viridis")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab