Graphics Reference
In-Depth Information
Figure 2-4.
2.2 Titles, Tags, Meshes and Texts
The commands available in MATLAB for these purposes are as follows:
title ('text')
adds the text used as the title of the graph at the Top in 2-D and 3-D graphics.
xlabel ('text')
places the text next to the
x
axis in 2-D and 3-D graphics.
ylabel ('text')
puts the text next to the y axis in 2-D and 3-D graphics.
zlabel ('text')
places the text beside axis
z
in a 3-D chart.
text (x, y, 'text')
places the text at the point
(x, y)
within the 2-D chart.
text (x, y, z, 'text')
places the text at the point
(x, y, z)
in a 3D graphic.
gtext ('text')
allows you to place text at a point selected with the mouse within a 2-D chart.
grid
locates grids in a 2-D or 3-D chart axes. The command
grid on
places the major grid
lines and
grid off
removes them. The
grid
command without a parameter toggles the grid
between
on
and
off.
The command
hold
keeps the current graph with all its properties,
so that subsequent graphs are placed on the same axis overlapping the existing one. The
option
hold on
activates the option and
hold off
deletes the option. The
hold
command
without a parameter toggles between
on
and
off
. Axis autoranging behavior is not affected
by the
hold
command.