What it does
cmocean supplies colour maps developed for oceanographic variables. Its collection includes ordered scales, scales centred on a midpoint and cyclic maps, with Python tools for plotting, reversing, cropping and sampling them. The Python package is distributed under the MIT open-source licence.
Install cmocean, import it and select a map from cmocean.cm for a Matplotlib plot. Thermal runs from cooler dark blues to warmer yellows; phase is cyclic. The gallery and lightness plots help explain these different structures.
Append _r to a map name to reverse it. Cropping tools trim a scale by percentage or by the data range and central value. Export tools can write 256 RGB samples per map to text files or create a sampled colour dictionary.
The optional plotting submodule needs the extra cmocean[plots] installation, which adds viscm and colorspacious. The MIT licence allows commercial reuse with its copyright and permission notices retained.
Strengths
- Examples connect colour-map choices to scientific data.
- Maps can be cropped, reversed or exported as numerical colour samples.
Watch out for
- The diagnostic plotting helpers require extra dependencies.
Best for
- Scientists and data designers preparing oceanographic or related numerical plots.
