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

    %% Set Data Aspect Ratio for Specific Axes Object
% Create a figure with two subplots and return the axes objects from the
% |subplot| function. Set the data aspect ratio for the lower subplot by
% specifying |ax2| as the first input argument to the |daspect| function.

% Copyright 2015 The MathWorks, Inc.


ax1 = subplot(2,1,1);
plot(1:10)

ax2 = subplot(2,1,2);
plot(1:10)
daspect(ax2,[1 2 1])