File Exchange

image thumbnail

Rainbow Colormap

version (55.8 KB) by Dr. Murtaza Khan
Rainbow Colormap


Updated 15 Jun 2015

View License

Compute transfer function of Rainbow Colormap and display image using Rainbow Colormap

Cite As

Dr. Murtaza Khan (2021). Rainbow Colormap (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Keisuke Ejiri

Keisuke Ejiri

Stephen Cobeldick

This submission merely replicates inbuilt functionality: the stated purpose of this submission is to

1) generate a rainbow colormap, and
2) plot the rainbow colormap's "transfer function".

The inbuilt JET function already offers a rainbow colormap, and colormap viewing is available using the function RGBPLOT, so in fact the main part of this submission can be replaced with the following twelve characters:


Just 12 characters that call inbuilt functions, instead of downloading three third-party functions from the internet... and RGBPLOT works with *all* colormaps too!

Then comes the question of why we need another rainbow colormap anyway, given the amount of discussion and research showing that rainbow colormaps are terrible at data representation. MATLAB has changed its default colormap to PARULA for exactly this reason:

And there are plenty of submissions on FEX that offer better colormaps than rainbow ones:

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

Inspired: squink(Colors,Gamma), jetwhite(Colours)

Community Treasure Hunt

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

Start Hunting!