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

    %% Query Data Aspect Ratio
% Create a surface plot and query.

% Copyright 2015 The MathWorks, Inc.


[x,y] = meshgrid(-2:.2:2);
z = x.*exp(-x.^2 - y.^2);
surf(x,y,z)
%%
% Query the data aspect ratio. The ratio indicates that the length of four
% units in the _x_-axis direction equals four units in the _y_-axis
% direction and one unit in the _z_-axis direction. For example, the length
% from 0 to 1 on the _x_-axis equals the length from 0 to 1 on the _y_-axis
% and 0 to 0.25 on the _z_-axis.

d = daspect