File Exchange

image thumbnail

Perceptually uniform colormaps

version 1.3.2 (241 KB) by Ander Biguri
New Improved colormaps taken from python.


Updated 02 Oct 2019

View Version History

View License

Perceptually uniform colormaps adds 4 new colormaps that are:

1) Perceptually uniform (delta color is equal in all delta data)
2) Colorblind friendly
3) Good at grayscale conversion
4) Pretty!

Colormaps have been taken from , the discussion of the new default colromaps in python's matplotlib.

It should work for any Matlab release (both with the new and old graphics handles)

Colormaps created by: Stéfan van der Walt and Nathaniel Smith.
The colormaps have been published under a (CC0) Creative Commons License by the original authors. I do not own any copyright on them, this is a simple repackaging of the colormaps for MATLAB.

Cite As

Ander Biguri (2020). Perceptually uniform colormaps (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (39)

Pamela Garcia

alok pandey

Bob photonics


Magma works well for spectrograms.

Ander Biguri

@Stephen Well, yes more or less. Back when I posted this the notice on top of the page was not there, and I did not find any information about licenses, so there was not much I could do. My mistake was not following up on licenses.

Stephen Cobeldick

@Ander: you were lucky that Viridis et al were released under the CC0 license :)

Addendum: it seems that the license files are in fact not distributed with MatPlotLib itself. I was just searching for Cynthia Brewer's license (a fairly distinctive name to search for) but the closest that I could locate was this statement: "for details, see the file LICENSE_COLORBREWER in the license directory of the matplotlib source distribution", e.g. which can be viewed on GitHub:
Interestingly other packages/libraries *do* include the full licenses with the distributed colormap code. I have no idea why MatPlotLib omits them.

Ander Biguri

Dear Stephen.

You are correct, I did this a while ago and forgot about it, but its no excuse to keep the information wrong. I really appreciate bringing this up and I will update the license information and text in the FEX submission.

Thanks again

Stephen Cobeldick

"However as they are inbuilt in python, they have no copyright..."

This statement is incorrect on two major points.

1. Python itself (the programming language) does not define any colormaps, inbuilt or otherwise. Nor, for that matter, does the Python language standard define anything related to plotting or GUIs.

2. Most of the colormaps distributed with MatPlotLib (which is NOT Python) are in fact covered by various types of OpenSource license. For example Cynthia Brewer's colormaps are licensed under an Apache v2 license, so it is NOT permitted to distribute them simply because they are included in MatPlotLIb: their required license requirements must also be met. You can find the relevant license information in the same file as the colormap data themselves (named "" in the MatPlotLib module).

Colormaps Viridis, Magma, Plasma, and Inferno have been released under a Creative Commons (CC0) license, which makes it possible to distribute them without their original license (however their authors do request that "We would appreciate credit if you use or redistribute these colormaps..."). However this ability to redistribute those specific colormaps without any specific license is solely due to the type of license that their creators originally released them under, and has nothing to do with them being distributed as part of MatPlotLib (or being related to Python).


Fernando Zigunov

My hero!

Micke Malmström

Joanna Young

Ander Biguri

Hi Murty,

I do not own the copyright of these colors, as the originals are from python (see link above). However as they are inbuilt in python, they have no copyright and you should be OK to use them freely.


Thanks a ton for these colormaps.
I am using magma for my article.
Are there any copyright requirements that need to be fulfilled or citations that need to be made in my article?

Gianluca Iori

William Warriner

Maxime Harazi

Ronny Bergmann

Guojin Feng

Great. Thanks for implementing this.

Luis Mendo


Stefan Appelhoff

Benjamin Miquel

Thank you. This is gold dust.

Fabio C

Fabio C

Very important! Should be default in MatLab!

Ander Biguri

Hi Tim,

I am glad that this colormaps can actually help! I can nor argue with what you can see better, but these colormaps have other advantages rather than only being colorblind friendly. They are perceptually uniform, which is a key feature for the proper showing of scientific data (else colors may mislead the reader) and they print very nicely in grayscale.


Thanks for this implementation. I'm red-green colourblind and I struggle to find colour maps that give me confidence that I am seeing the same level of information as non-colourblind people. These are pretty good but in each one I still lose definition in some region. I have just compared with a non-colourblind person I share an office with. I see the regular colourmap and the 2 deuteranopia colourmaps below them as identical where he sees the 'complete deuteranopia' as quite different to the other 2 (so their colourblind simulation works well). On balance I get less loss of definition using the Light-Bartlein diverging blue-brown or blue-red colourmaps so I think I'll stick with them despite their poor black and white reproduction ( But thanks for giving me some more useful options.


Katja Müller

Ander Biguri

Hi arnold,

Happy you liked them, indeed I also sometimes cut the "black" parts of the colormaps! The fake_parula is there for MATLAB version previous to 2014b, where parula does not exists.


thanks for these excellent colormaps.
I've been annoyed with matlabs jet option for years and then parula came and I started to think about colormaps. I compared yours to parula and they look good, I like it that hue doesn't change so much BUT, parula resolves more in the darker areas on a screen which, and this is a guess, not measured, is due to the fact that it is either a bit more nonlinear (steeper) there than viridis & Co or because the almost blackish-phase is more extended. I solved it for me by modifying the functions in the way that I cut off the darkest 15% and now I am able to see more detail in the shadows.

My favorite: inferno - with the darkest 15% cut off.

What is the 'fake_parula' for? Just fun? :P


Ander Biguri

Thank you for the feedback Israel and Tijs. The name of parula.m has been changed to avoid shadowing and the wrong colors when interpolating the colormaps have been fixed.

Israel Vaughn

These colormaps are really great.

I found a bug due to linear interpolation in the magma colormap. magma(128) produces a green band for the 85th color output. This is because there is a discontinuity in hue, and the linear interp puts a value in the middle of the discontinuity.

Otherwise love them.

Tijs Van Oevelen

Hi. A name conflict arises because of the inclusion of parula.m in the package. Matlab already has a function named parula.m. This causes problems when generating a colorbar for example. Please consider renaming this file in your package.

Jonathan Suever

E. Cheynet

Ander Biguri

Hi Bob DA. Glad you like them. I just updated the colormaps to accept an extra argument for the size of them. Thanks for the suggestion. However note that color interpolation should be done in HSV space, not in RGB, as it wont give the right results in RGB.

Bob DA

Beautiful colormaps! It would be nice if users could also specify the desired colormap size (as is possible with the Matlab defaults). A quick & dirty way to do that is to add to the end of each file (where 'm' is the desired size):

if nargin < 1
data2 = data;
data2 = zeros(m,3);
for i = 0:m-1
L = size(data,1);
data2(i+1,:) = interp1((0:L-1),data,i*(L-1)/(m-1));

cheng joylin

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!