%% Set z-Axis Limits for Specific Axes
% Starting in R2019b, you can display a tiling of plots using the tiledlayout and nexttile functions. Call the tiledlayout function to create a 2-by-1 tiled chart layout. Call the nexttile function to create the axes objects ax1 and ax2. Plot data into each of the axes. Then set the z-axis limits for the bottom plot by specifying ax2 as the first input argument to zlim.

[X,Y,Z] = peaks;
tiledlayout(2,1)
ax1 = nexttile;
surf(X,Y,Z)

ax2 = nexttile;
surf(X,Y,Z)
zlim(ax2,[-5 5])

% Copyright 2019 The MathWorks, Inc.