No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.4 | 9 ratings Rate this file 5 Downloads (last 30 days) File Size: 4.41 KB File ID: #12804 Version: 1.0
image thumbnail




26 Oct 2006 (Updated )

Creates full spectrum, blue-green-orange-salmon, colormap that maps to linear grayscale.

| Watch this File

File Information

Creates a broad range color map that looks good in color as well as when reduced to grayscale for low cost publication.

Finished colormap encodes small values with a bluish color, intermediate values in green to orange, and large values with a redish/salmon color. The greyscale is linear.



This file inspired Bipolar Colormap, Cubehelix Colormaps: Beautiful, Distinct, Versatile!, and Color Brewer: Attractive And Distinctive Colormaps.

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (12)
08 Jan 2016 Davide

Davide (view profile)

Pretty nice colormap but as already noted by Will Robertson it crashes for number of leves < 3.
This can be a rough solution.
Add this after the nargin checks:

if numLevels==1
numLevels= size(colormap, 1);
elseif numLevels==2
numLevels= size(colormap, 1);

And this before the debug plot option:
if realnumLevels==1
RGBmap = RGBmap(1,:);
elseif realnumLevels==2
RGBmap = [RGBmap(1,:); RGBmap(end,:)];

07 Jan 2015 Raj

Raj (view profile)

It looks like Mathworks has basically taken this idea and made it the new default colormap:

Comment only
04 Jul 2014 Matteo Niccoli

Great colormap

28 May 2014 Raj

Raj (view profile)

I love this colormap. I've used it exclusively in all my MATLAB work since I discovered it. Great submission.

21 Feb 2012 Ondrej

Ondrej (view profile)

Other suggestion is to add line:


in the debugplot option to see the resulting grayscale.

Comment only
21 Feb 2012 Ondrej

Ondrej (view profile)

What about adding a next optional parameter which would set the "darkness/lightness", such that the mapping between color and grayscale wouldn't be linear.
Easy way how to do is to add a line, e.g.
RGBmap = brighten(RGBmap,0.2)
The problem is, however, that the mapping is not smooth (as can be seen on the plot, if I do e.g. colorGray(100,1)).

21 Feb 2012 Ondrej

Ondrej (view profile)

23 Dec 2008 Oliver Woodford

I wrote something like this (independently) myself. However, it is full greyscale (i.e. black to white) and has a wider gamut of colours. It is available as the 'contrast' colourmap of the SC package (id 16233), which also has other "colour to gray" colourmaps too: 'earth', 'pinker', 'pastel'.

Comment only
23 Sep 2008 Manuel Guizar

The code works well but it does not use the entire gray scale range.

16 Jan 2008 Garret B

Alex is my hero!

19 Aug 2007 Will Robertson

Great for large numbers of levels, but quite poor for just a few (e.g., if you're labelling three or four lines on a plot). In fact, the code breaks for numberOfLevels < 3. But I don't believe that's the goal of the package, so that's okay.

07 Dec 2006 Evan Variano

Colormap that unites grayscale and full color - hooray! - Where have you been all my life?!

Contact us