MATLAB: How to apply customized colormap to other plots

colormap

I know how to set up colormap with the GUI interface by going to the "edit"=>"colormap".
However, I have a total of about 20 plus plots that need the same customized colormap. Other than customizing each of them manually, is there a way to set it up digitially in the m-code?
Thank you.

Best Answer

Make up a 256 row by 3 matrix with all the colors in it. For example
myColorMap = jet(256);
or you can do your own custom colors, whatever you want. Then just call
colormap(myColorMap);
after you switch focus to a figure that you want that color map applied to.