File Exchange

image thumbnail


version (186 KB) by Joshua Atkins
Extra colormaps for plotting. Contains diverging, sequential, categorical, and perceptual maps.


Updated 02 Mar 2011

View Version History

View License

This is an embarrassingly simple function to augment the currently available MATLAB colormaps. It works as a seamless replacement for the current maps like jet and hsv. So to use it you just call colormap(othercolor('colorname')). The function handles interpolating to any number of points (othercolor('colorname',numpoints)) and uses the current axis as the reference if numpoints is not specified.

The available maps are stored in the file colorData.mat and you can easily add your own maps. To get a list of available names just call othercolor() without any arguments.

The 400+ colormaps are from 3 sources:
Mathematica (indexed, physical, gradient, and named)

Some of these maps are better suited for sets of bar or line plots (particularly the qualitative sets). In those cases the last number in the name is the number of indexed colors, so it would probably be fitting to set M to that number to avoid interpolation. Example:

>> figure
>> colorscheme = othercolor('Set16',6);
>> set(gcf,'DefaultAxesColorOrder',colorscheme);
>> plot(rand(6,20));
>> legend(num2str((1:6)'))

* I'm looking for ideas on how to best organize these maps now that there are 400+ of them. If you have suggestions please leave them in the comments or send me an email.

Cite As

Joshua Atkins (2021). othercolor (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (26)

ym f

Amy Qiao

Sunin Kingdom

It's GREAT! Thanks!

Yuanxin Lo

Many thanks. However I am wondering is there any possibility to add some new color scheme into mycolor?

wonsoek lee

Qinghua Ke

Dylan Gaeta

Thanks very much for this! There are not enough single-color white-to-dark gradients available in MATLAB, and this fills that gap nicely.

One point to note: when I run the `othercolor()` command, I receive the following warning:
Warning: INTERP1(...,'CUBIC') will change in a future release. Use INTERP1(...,'PCHIP') instead.

I am using the `othercolor()` function as follows:


Pablo Vicente


Worked as described right away! Very nice addition to the extremely limited defaults.

Dylan Gaeta

Emgo He

Vince Clementi

Great stuff here. Any advice on how I could invert the distribution of any of the available? Cheers.

Bryn Ronalds

Abraham FR

cheng joylin

fan zhang

great, wonderful, find what I need

Nicolas Beuchat


Excellent collection of colormaps! If more 4 color blends (like matlab jet) are added, it would improve it further.


Matteo Niccoli

Hi Joshua, nice collection, thanks for the effort! - very handy!

In my mind the best criteria for organizing colorbars would be the TYPE OF DATA they are intended to be used with, see:
and TASK they are best suited for. There's a bunch of papers recommended in my submission at:

David Wilson

Joshua Atkins

Thanks, Dave. I tried briefly to get the Mathematica color schemes into MATLAB - that was my initial inspiration, but had no luck. I'm planning to try again this weekend.

Oleg - I submitted an update with your helpful suggestion, so it should be up soon. I've also included the data in the new update.

David Wilson

Some interesting and useful color schemes are given in the Mathematica help documentation for colordata. It would be really neat to reproduce those in Matlab.

Oleg Komarov

Good idea, has L1 line, help, example, author details but I would change the core to get rid of the eval calls

% load color data
data = load('colorData.mat',n);

if isempty(fieldnames(data))
c = [];
c = interp1(linspace(0,1,size(data.(n),1)),data.(n),linspace(0,1,m),'cubic');

In this case if an unknown map is called c is empty.

Another approach would be to hardcode the maps into a structure in a need for the mat file then.


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

Community Treasure Hunt

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

Start Hunting!