% Draw a scalar field
[x,y] = meshgrid(linspace(-pi,pi,30));
z = cos(x).*sin(y);

subplot(1,2,1)
title('Demo of pcolor: shading flat');
pcolor(x,y,z);
shading flat

subplot(1,2,2)
title('shading interp');
pcolor(x,y,z);
shading interp
