| 3-D Visualization | ![]() |
Specifying Aspect Ratio
The axis command enables you to adjust the aspect ratio of graphs. Normally MATLAB stretches the axes to fill the window. In many cases, it is more useful to specify the aspect ratio of the axes based on a particular characteristic such as the relative length or scaling of each axis. The axis command provides a number of useful options for adjusting the aspect ratio:
axis equal changes the current axes scaling so that equal tick mark increments on the x-, y-, and z-axis are equal in length. This makes the surface displayed by sphere look like a sphere instead of an ellipsoid. axis equal overrides stretch-to-fill behavior.
axis square makes each axis the same length and overrides stretch-to-fill behavior.
axis vis3d freezes aspect ratio properties to enable rotation of 3-D objects and overrides stretch-to-fill. Use this option after other axis options to keep settings from changing while you rotate the scene.
axis image makes the aspect ratio of the axes the same as the image.
axis normal restores the current axis box to full size and removes any restrictions on the scaling of the units. It undoes the effects of axis square. Used in conjunction with axis auto, it undoes the effects of axis equal.
The axis command works by manipulating axes graphics object properties.
| Specifying Axis Scaling | Example -- axis Command Options | ![]() |
© 1994-2005 The MathWorks, Inc.