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. A subset of TeX notation produces Greek letters. You can also set these options interactively. See Editing Plots for more information.
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.}')
Controlling the Axes | Saving a Figure |