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

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

% Copyright 2015 The MathWorks, Inc.


x = linspace(0,10,1000);
y = sin(10*x).*exp(.5*x);
ax1 = subplot(2,1,1);
plot(x,y)

ax2 = subplot(2,1,2);
plot(x,y)
ylim(ax2,[-10 10])