\section{LEGEND Add Legent to Plot}

\subsection{Usage}

This command adds a legend to the current plot.  Currently, the
following forms of the \verb|legend| command are supported.  The
first form creates a legend with the given labels for the data
series:
\begin{verbatim}
  legend('label1','label2',...)
\end{verbatim}
where \verb|'label1'| is the text label associated with data plot 1
and so on.  You can also use the \verb|legend| command to control
the appearance of the legend in the current plot.  To remove the
legend from the current plot, use
\begin{verbatim}
  legend('off')
\end{verbatim}
To hide the legend for the current plot (but do not remove it)
\begin{verbatim}
  legend('hide')
\end{verbatim}
And to show the legend that has been hidden, use
\begin{verbatim}
  legend('show')
\end{verbatim}
You can also toggle the display of the box surrounding the legend.
Use
\begin{verbatim}
  legend('boxoff')
\end{verbatim}
or 
\begin{verbatim}
  legend('boxon')
\end{verbatim}
to turn the legend box off or on, respectively.  To toggle the
visible state of the current legend, use
\begin{verbatim}
  legend('toggle')
\end{verbatim}
Specifying no arguments at all (apart from an optional location 
argument as specified below) results in the legend being rebuilt.
This form is useful for picking up font changes or relocating the
legend.
\begin{verbatim}
  legend
\end{verbatim}
By default, the \verb|legend| command places the new legend in the 
upper right corner of the current plot.  To change this behavior,
use the \verb|'location'| specifier (must be the last two options to the command)
\begin{verbatim}
  legend(...,'location',option)
\end{verbatim}
where \verb|option| takes on the following possible values
\begin{itemize}
\item  \verb|north|,\verb|N| - top center of plot 

\item  \verb|south|,\verb|S| - bottom center of plot

\item  \verb|east|,\verb|E| - middle right of plot

\item  \verb|west|,\verb|W| - middle left of plot

\item  \verb|northeast|,\verb|NE| - top right of plot (default behavior)

\item  \verb|northwest|,\verb|NW| - top left of plot

\item  \verb|southeast|,\verb|SE| - bottom right of plot

\item  \verb|southwest|,\verb|SW| - bottom left of plot

\end{itemize}
This implementation of \verb|legend| is incomplete relative to the 
MATLAB API.  The functionality will be improved in future versions
of FreeMat.
