Getting Started |
Axis Labels and Titles
The xlabel
, ylabel
, and zlabel
commands add x-, y-, and z-axis labels. The title
command adds a title at the top of the figure and the text
function inserts text anywhere in the figure.
You can produce mathematical symbols using LaTeX notation in the text string, as the following example illustrates:
t = -pi:pi/100:pi; y = sin(t); plot(t,y) axis([-pi pi -1 1]) xlabel('-\pi \leq {\itt} \leq \pi') ylabel('sin(t)') title('Graph of the sine function') text(1,-1/3,'{\itNote the odd symmetry.}')
You can also set these options interactively. See Editing Plots for more information.
Note that the location of the text string is defined in axes units (i.e., the same units as the data). See the annotation
function for a way to place text in normalized figure units.
Controlling the Axes | Saving Figures |
© 1994-2005 The MathWorks, Inc.