## AXIS Setup Axis Behavior

Section: Handle-Based Graphics

### Usage

Control 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

where `x` is a 4-vector for 2D plots, and a 6-vector for 3D plots. 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.

      axis auto

The next option sets all of the axis limits to `manual` mode. This state turns off automatic scaling of the axis based on the children of the current axis object.

      axis manual

The next option sets the axis limits to fit tightly around the data.

      axis tight

The next option adjusts the axis limits and plotbox aspect ratio so that the axis fills the position rectangle.

      axis fill

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).

      axis ij

The next option puts the axis in normal mode, with the origin at the lower left corner.

      axis xy

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.

      axis equal

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.

      axis image

The next option makes the axis box square.

      axis square

The next option restores many of the normal characteristics of the axis. In particular, it undoes the effects of `square` `image` and `equal` modes.

      axis normal

The next mode freezes axis properties so that 3D objects can be rotated properly.

      axis vis3d

The next mode turns off all labels, tick marks and background.

      axis on

The next mode turns on all labels, tick marks and background.

      axis off

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 `outerposition` vector.

      axis maximal

The `axis` command can also be applied to a particular axis (as opposed to the current axis as returned by `gca`) handle

      axis(M,...)