www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/SetzAxisLimitsForSpecificAxesExample.m

    %% Set _z_-Axis Limits for Specific Axes
% Create a figure with two subplots and plot the same data in each subplot.
% Set the _z_-axis limits for the bottom subplot.

% Copyright 2015 The MathWorks, Inc.


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

ax2 = subplot(2,1,2);
surf(X,Y,Z)
zlim(ax2,[-5 5])