Next: Plot Annotations, Previous: Three-Dimensional Plotting, Up: Plotting
Set axis limits for plots.
The argument limits should be a 2, 4, or 6 element vector. The first and second elements specify the lower and upper limits for the x axis. The third and fourth specify the limits for the y axis, and the fifth and sixth specify the limits for the z axis.
Without any arguments,
axis
turns autoscaling on.With one output argument,
x=axis
returns the current axes (this is not yet implemented for automatic axes).The vector argument specifying limits is optional, and additional string arguments may be used to specify various axis properties. For example,
axis ([1, 2, 3, 4], "square");forces a square aspect ratio, and
axis ("labely", "tic");turns tic marks on for all axes and tic mark labels on for the y-axis only.
The following options control the aspect ratio of the axes.
"square"
- Force a square aspect ratio.
"equal"
- Force x distance to equal y-distance.
"normal"
- Restore the balance.
The following options control the way axis limits are interpreted.
"auto"
- Set the specified axes to have nice limits around the data or all if no axes are specified.
"manual"
- Fix the current axes limits.
"tight"
- Fix axes to the limits of the data (not implemented).
The option
"image"
is equivalent to"tight"
and"equal"
.The following options affect the appearance of tic marks.
Note, if there are no tic marks for an axis, there can be no labels.
"on"
- Turn tic marks and labels on for all axes.
"off"
- Turn tic marks off for all axes.
"tic[xyz]"
- Turn tic marks on for all axes, or turn them on for the specified axes and off for the remainder.
"label[xyz]"
- Turn tic labels on for all axes, or turn them on for the specified axes and off for the remainder.
"nolabel"
- Turn tic labels off for all axes.
The following options affect the direction of increasing values on the axes.
"ij"
- Reverse y-axis, so lower values are nearer the top.
"xy"
- Restore y-axis, so higher values are nearer the top.
Return the named property p from the graphics handle h. If p is omitted, return the complete property list for h. If h is a vector, return a cell array including the property values or lists respectively.
Set the named property value or vector p to the value v in the graphics handle h.