If you look at one of the plots that you've been producing during this lesson,
you'll notice that they are not labeled very well, indeed not at all as a default. Neither the horizontal nor the vertical axis not labeled, and
the graph as a whole has no title. It is possible to put better labels onto
plots, and it is important to do so when you hand in plots as part of your
homework assignments. In this section we'll see how.
Let's suppose that you need to plot the function 2t^2, where
t is time measured in seconds and the result is altitude measured in feet.
Our first attempt gives a relatively uninformative plot:
Plot[2*t^2, {t, 0, 1}];
Fortunately, Mathematica's Plot[ ] function supports a wide range of options for things like adding labels to the plot (indeed, if you are willing to put in the time it is possible to do almost anything in a plot).
The options of relevance are:
AxesLabel
PlotLabel
and
Frame Label
(if you choose to put a ``frame'' around your plot. These options are all specified with the Mathematica ``goes to'' symbol -> obtained by typing a hyphen and a geater than sign. For example, in the above case we could write:
Plot[2*t^2, {t, 0, 1}, AxesLabel-> {Time, Altitude},
PlotLabel-> Altitude versus Time];
Execute this command and see how the plot comes out now.
Why might it be desirable to do this? Click here for the answer.