MATLAB: How to set contourf colors

colourf

I use contour for plot three concentric isolines, now I would like to fill the area inside this isolines with a choosen color, for example heavy green, medium green and light green. How I can do it?
I tried with contourf and colormap but I'm not enought skilled for properly set the colors. This is my code:
data = fopen ( datafile,'r');
M = fscanf ( data , '%f', [128, 128]);
[x,y] = meshgrid(-gr:2*gr/127:gr);
contourf(x,y,M,[5000 1000 500]);
map = [0 0.6 0.2; 0 0.8 0.2; 0 1 0.2];
colormap (map);
Any helps?

Best Answer

I wrote the contourfcmap function to do exactly that... much more reliable than trying to fiddle with colormaps and color limits.