From: May on
I was wondering how you can make a custom colormap.

I want a colormap that is a gradient of various green shades and a colormap that is a gradient of various red shades.

Any help is appreciated, thank you.
From: Walter Roberson on
May wrote:
> I was wondering how you can make a custom colormap.
>
> I want a colormap that is a gradient of various green shades and a
> colormap that is a gradient of various red shades.

A colormap is just a double precision array of colors, N x 3 (RGB), each
component in the range 0 to 1.0 . Fill in the array any way you want.

For example for one with 72 green entries:

M = 72;
G = fliplr(linspace(0,1,M)) .';
myGmap = horzcat(zeros(size(G)), G, zeros(size(G)));
From: Steven Lord on

"Walter Roberson" <roberson(a)hushmail.com> wrote in message
news:r2qUn.111151$304.28291(a)newsfe12.iad...
> May wrote:
>> I was wondering how you can make a custom colormap.
>>
>> I want a colormap that is a gradient of various green shades and a
>> colormap that is a gradient of various red shades.
>
> A colormap is just a double precision array of colors, N x 3 (RGB), each
> component in the range 0 to 1.0 . Fill in the array any way you want.
>
> For example for one with 72 green entries:
>
> M = 72;
> G = fliplr(linspace(0,1,M)) .';
> myGmap = horzcat(zeros(size(G)), G, zeros(size(G)));

To extend what Walter said, this GUI may be of interest to you:

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/colormapeditor.html

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: Doug Hull on
http://www.mathworks.com/matlabcentral/fileexchange/17552-makecolormap

This makes good colormaps also.