File Exchange

image thumbnail

crameri perceptually uniform scientific colormaps

version 1.08 (2.62 MB) by Chad Greene
Perceptually uniform scientific colormaps from Fabio Crameri.


Updated 04 Feb 2021

View Version History

View License

When color is a numerical axis, it should not be distorted.

This function is similar to the cmocean (Thyng et al., 2016) function also found on File Exchange, but this one's for Fabio Crameri's colormaps (Crameri 2018a,b).

Cite As

Crameri, Fabio. Scientific Colour Maps. Zenodo, 2019, doi:10.5281/ZENODO.1243862.

View more styles

Crameri, Fabio. “Geodynamic Diagnostics, Scientific Visualisation and StagLab 3.0.” Geoscientific Model Development, vol. 11, no. 6, Copernicus GmbH, June 2018, pp. 2541–62, doi:10.5194/gmd-11-2541-2018.

View more styles

Comments and Ratings (16)

Chad Greene

@mkoh Thanks for alerting me to the latest update. I've updated the function for version 7.0 colormaps.


Could you please update to the latest version 7.0 colormaps?

Matthew Thompson


Eyal Gruntman

Chad Greene

@Tim: Great catch. Thanks for tracking down the error. I've just uploaded a version in which I fixed the issue by changing the variable names in the .mat file. Thanks again.


Line 97: ColormapName = lower(ColormapName) makes it impossible to access "grayC" (and several other colormaps found in the .mat file) using: cmap = crameri('ColormapName')

Chad Greene

@Chris: Check out the 'pivot' option. Is that what you mean?


Great submission. One suggestion: it would be nice to be able to scale the diverging maps asymmetrically about the pivot.

Matti Kummu

Agnes Kiraly

Lauren Simkins

E. Cheynet

Chad Greene

@Stephen, you are quite thorough! Thanks, I've edited the input checking as you suggested.

Stephen Cobeldick

A tidy function and a useful addition to FEX. Well documented, as all of Chad Greene's FEX submissions are. Thank you Chad!

I note that the code used to check for the '-' character is not limited to one at the beginning of the string, so 'Col-orName', or 'ColorN-ame', or even 'C-o-l-o-r-N-a-m-e' would also pass. Is this intentional? STRNCMP would give the documented behavior.

Fabio C

MATLAB Release Compatibility
Created with R2017b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: cmocean perceptually-uniform colormaps

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!