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).
Crameri, Fabio. Scientific Colour Maps. Zenodo, 2019, doi:10.5281/ZENODO.1243862.
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.
@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')
@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.
@Stephen, you are quite thorough! Thanks, I've edited the input checking as you suggested.
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.
Inspired by: cmocean perceptually-uniform colormaps
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!