%% Maintain Current z-Axis Limits
% Use manual mode to maintain the current z-axis limits when you add more plots to the axes.
% First, create a 3-D scatter plot.

theta = linspace(0,2*pi);
X = cos(theta);
Y = sin(theta);
Z = theta;
scatter3(X,Y,Z)

%
% Set the z-axis limits mode to manual so that the limits to not change. Use hold on to add a second plot to the axes.

zlim manual
hold on 
Znew = 5*theta;
scatter3(X,Y,Znew)
hold off

%
% The z-axis limits do not update to incorporate the new plot.
% Switch back to automatically updated limits by setting the mode to automatic.

zlim auto

% Copyright 2015 The MathWorks, Inc.