Syntax

Description

axis(limits) sets
the x-axis and y-axis limits
for the current axes. Specify limits as a four-element
of the form [xmin xmax ymin ymax]. To additionally
set the z-axis limits, specify a six-element
vector. To additionally set the color limits, specify an eight-element
vector.

axis ydirection controls
the placement of the coordinate system origin and the direction of
increasing y values. Set ydirection to ij to
place the origin at the upper left corner of the axes. The y values
increase from top to bottom. Set ydirection to xy to
place the origin at the lower left corner. The y values
increase from bottom to top. This is the default value.

axis visibility controls
the visibility of the axes background. Set visibility to off to
turn off the display of the axes background. Plots in the axes still
display. Set visibility to on to
display the axes background. This is the default value.

___ = axis(ax,___) uses
the axes specified by ax instead of the current
axes. You can specify an axes with any of the input or output arguments
in the previous syntaxes. When you specify an axes, use single quotes
around input arguments that are character strings, for example, axis(ax,'equal').

[xmin xmax ymin ymax zmin zmax cmin cmax] —
Additionally set the color limits. cmin is the
data value that maps to the first color in the colormap. cmax is
the data value that maps to the last color in the colormap.

Note:
For partially automatic limits, use inf or -inf for
the limits you want the axes to choose automatically. For example, axis([-inf
10 0 inf]) lets the axes choose the appropriate minimum x-axis
limit and maximum y-axis limit. It uses the specified
values for the maximum x-axis limit and minimum y-axis
limit.

If you specify the limits, then the XLim, YLim, ZLim,
and CLim properties
for the axes change to the specified values. Additionally, the associated
mode properties change to 'manual'.

Fit the axes box tightly around the data by setting the axis
limits equal to the range of the data.

XLimMode, YLimMode, and ZLimMode change
to 'auto'. The limits automatically update to incorporate
new data added to the axes. To keep the limits from changing when
using hold on, use axis
tight manual.

Output Arguments

Current limit values, returned as a four-element or six-element
vector. For axes with a 2-D view, lim is of the
form [xmin xmax ymin ymax]. For axes with a 3-D
view, lim is of the form [xmin xmax ymin
ymax zmin zmax].

The XLim, YLim, and ZLim properties
for the axes contain the limit values.