3-D Visualization Previous page   Next Page

Axes Aspect Ratio Properties

The axis command works by setting various axes object properties. You can set these properties directly to achieve precisely the effect you want.

Property
Description
DataAspectRatio
Sets the relative scaling of the individual axis data values. Set DataAspectRatio to [1 1 1] to display real-world objects in correct proportions. Specifying a value for DataAspectRatio overrides stretch-to-fill behavior.
DataAspectRatioMode
In auto, MATLAB selects axis scales that provide the highest resolution in the space available.
PlotBoxAspectRatio
Sets the proportions of the axes plot box (set box to on to see the box). Specifying a value for PlotBoxAspectRatio overrides stretch-to-fill behavior.
PlotBoxAspectRatioMode
In auto, MATLAB sets the PlotBoxAspectRatio to [1 1 1] unless you explicitly set the DataAspectRatio and/or the axis limits.
Position
Defines the location and size of the axes with a four-element vector: [left offset, bottom offset, width, height].
XLim, YLim, ZLim
Sets the minimum and maximum limits of the respective axes.
XLimMode, YLimMode, ZLimMode
In auto, MATLAB selects the axis limits.

By default, MATLAB automatically determines values for all of these properties (i.e., all the modes are auto) and then applies stretch-to-fill. You can override any property's automatic operation by specifying a value for the property or setting its mode to manual. The value you select for a particular property depends primarily on what type of data you want to display.

Much of the data visualized with MATLAB is either

In the first case, it is generally desirable to select axis limits that provide good resolution in each axis direction and to fill the available space. Real-world objects, on the other hand, need to be represented accurately in proportion, regardless of the angle of view.


Previous page  Additional Commands for Setting Aspect Ratio Default Aspect Ratio Selection Next page

© 1994-2005 The MathWorks, Inc.