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, F. (2018). Scientific colour-maps. Zenodo. http://doi.org/10.5281/zenodo.1243862
Crameri, F. (2018), Geodynamic diagnostics, scientific visualisation and StagLab 3.0, Geosci. Model Dev., 11, 2541-2562, doi:10.5194/gmd-11-2541-2018 .
Thyng, K. M., Greene, C. A., Hetland, R. D., Zimmerle, H. M., & DiMarco, S. F. (2016). True colors of oceanography: Guidelines for effective and accurate colormap selection. Oceanography, 29(3), 9-13. http://dx.doi.org/10.5670/oceanog.2016.66
Chad Greene (2020). crameri perceptually uniform scientific colormaps (https://www.mathworks.com/matlabcentral/fileexchange/68546-crameri-perceptually-uniform-scientific-colormaps), MATLAB Central File Exchange. Retrieved .
@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.
Previously forgot to include turku. All of them should be in there now.
Added oslo colormap (previously forgot to include it in the .mat file).
Updated screenshot and edited input checking (regexp replaced with strncmp, as suggested by Stephen Cobeldick).
Published as a .zip because the .mltbx upload failed.
Inspired by: cmocean perceptually-uniform colormaps