How can I get a colormap that has the colors that varies smoothly from blue, through white, to red?

I want to use a colormap for my contour plot that looks like the built-in colormap 'Jet', but I do not want the scale to contain the color green, but white instead. Can somebody help me?

 Accepted Answer

There's a programmatic way of doing it, but this is the GUI point and click method; Right click on the colorbar -> Open Colormap Editor The colorbar will appear as a horizontal stripe with little flags below it. Double click the green flag. This brings up a color selection window, pick white and go OK.
To do this automatically in the future you can save the colormap with;
myColormap = colormap;
save('colormapsavefile.mat','myColormap');
To apply;
load('colormapsavefile.mat');
colormap(myColormap);
With some tweaking you can set the default colormap using this method and the startup.m file.

More Answers (0)

Categories

Tags

Asked:

on 18 Jul 2012

Commented:

DGM
on 15 Jan 2023

Community Treasure Hunt

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

Start Hunting!