AXIS Setup Axis Behavior
Section: Handle-Based Graphics
UsageControl the axis behavior. There are several versions of the axis command based on what you would like the axis command to do. The first versions set scalings for the current plot. The general syntax for its use is
axis([xmin xmax ymin ymax zmin zmax cmin cmax])
which sets the limits in the X, Y, Z and color axes. You can also set only the X, Y and Z axes:
axis([xmin xmax ymin ymax zmin zmax])
or only the X and Y axes:
axis([xmin xmax ymin ymax])
To retrieve the current axis limits, use the syntax
x = axis
x is a 4-vector for 2D plots, and a 6-vector for
There are a number of axis options supported by FreeMat.
The first version sets the axis limits to be automatically
selected by FreeMat for each dimension. This state is the
default one for new axes created by FreeMat.
The next option sets all of the axis limits to
mode. This state turns off automatic scaling of the axis
based on the children of the current axis object.
The next option sets the axis limits to fit tightly around the data.
The next option adjusts the axis limits and plotbox aspect ratio so that the axis fills the position rectangle.
The next option puts the axis in matrix mode. This mode is equivalent to the standard mode, but with the vertical axis reversed. Thus, the origin of the coordinate system is at the top left corner of the plot. This mode makes plots of matrix elements look normal (i.e., an identity matrix goes from upper left to lower right).
The next option puts the axis in normal mode, with the origin at the lower left corner.
The next option sets the axis parameters (specifically the data aspect ratio) so that equal ticks on each axis represent equal length. In this mode, spheres look spherical insteal of ellipsoidal.
The next option is the same as
axis equal, but sets the
plot box to fit tightly around the data (so no background shows
through). It is the best option to use when displaying images.
The next option makes the axis box square.
The next option restores many of the normal characteristics of
the axis. In particular, it undoes the effects of
The next mode freezes axis properties so that 3D objects can be rotated properly.
The next mode turns off all labels, tick marks and background.
The next mode turns on all labels, tick marks and background.
The next mode is similar to
axis off, but also repacks the
figure as tightly as possible. The result is a plot box that
takes up the entire
axis command can also be applied to a particular axis
(as opposed to the current axis as returned by