%% Control Colormap Limits
%% Create the surface

[X,Y] = meshgrid(-10:10);
Z = X + Y;
s = surf(X,Y,Z);
xlabel('X');
ylabel('Y');
zlabel('Z = C');
colorbar

%
%% Narrow the range

caxis([0 20]);

%
%% Widen the range

caxis([-60 20]);

% Copyright 2012 The MathWorks, Inc.