%% Colored Surface Plots
% This example shows how to graph the sinc function as a surface plot, specify a colormap, and add a color bar to show the mapping of data to color.
% A surface plot is similar to a mesh plot except that the rectangular faces of the surface are colored. The color of each face is determined by the values of Z and the colormap (a colormap is an ordered list of colors).

[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
surf(X,Y,Z)
colormap hsv
colorbar

% Copyright 2015 The MathWorks, Inc.