Graphics Programs Reference

In-Depth Information

ans =

[]

>> gcf

ans =

1

Exercise 16
The m-file
objects.m
creates a graphic with

assorted objects on it. Run
objects
and try clicking on the objects

to make them current. Investigate what happens when you do

get(gco,'type')
,or
delete(gco)
. (Answer on page 191.)

32 Axes Effects

32.1 The Axis Command

Axes objects have many properties you can modify to alter details such

as tick mark labels, positioning of axes, direction of tick marks, and so

on. These can be changed using the
get
and
set
commands. You can

also change the way axes behave using the
axis
command, which is an

easy way to set some
axis
and related commands to achieve frequently

sought effects. Let us look first at the
axis
command. These are the

available options (adapted from the help entry):

axis([xmin xmax ymin ymax])
sets scaling for the
x
- and
y
-axes on

the current plot.

axis([xmin xmax ymin ymax zmin zmax])
sets the scaling for the
x
-,

y
-, and
z
-axes on the current 3-D plot.

v = axis
returns a row vector containing the scaling for the current

plot. If the current view is two-dimensional,
v
has four components;

if it is three-dimensional,
v
has six components.

axis auto
returns the axis scaling to its default, automatic mode where,

for each dimension, “nice” limits are chosen based on the extents

of all line, surface, patch, and image children.

axis manual
freezes the scaling at the current limits, so that if
hold
is

turned on, subsequent plots will use the same limits.

axis tight
sets the axis limits to the range of the data.

axis fill
sets the axis limits and
PlotBoxAspectRatio
so that the

axis fills the position rectangle. This option only has an effect if

PlotBoxAspectRatioMode
or
DataAspectRatioMode
are manual.

axis ij
puts matlab into its “matrix” axes mode. The coordinate

system origin is at the upper left corner. The
i
axis is vertical and