MATLAB: How to change the colors in colormap function

cmap

I have the expression below to plot the power with respect to x and y position. The colors vary based on the power level. I plotted the power using the expression below however the colors are gray, black etc. I need the colors to be red indicating high power, orange, blue, yellow, as the power goes from high to low.
cmap = 0:1/256:1;
cmap = [ cmap; cmap; cmap ]';
imagesc(data.power);
axis equal;
axis xy;
colormap( cmap );

Best Answer

You can try one of the many built-in colormaps such as hsv, jet, parula, etc.
cmap = jet(256);
colormap(cmap);
colorbar;