[X,Y] = meshgrid(-pi:0.1:pi,-pi:0.1:pi);  % create a grid of X and Y values

Z=cos(X).*cos(Y);  % generate data (Z) for the image, based on X and Y

imagesc(Z) % plot image with auto-scaled color range

%   axis([-1 1 0 1])
%   axis square


%colormap(hot); % choose the "hot" colormap - there are many others to choose from:
%colormap(vga); % another possibility
%colormap(jet); % another possibility
colormap(spring); % another possibility


%caxis auto; % this auto-scales the color range
caxis([0 .8]) % sets the color range between 0 and 0.8
%caxis([0 2])
%caxis([0 .1])

colorbar; % this adds the colorbar legend to the image