Documentation Center    • Trial Software   • Product Updates
Graph legend for lines and patches   legend_handle = legend(...)
[legend_h,object_h,plot_h,text_strings] = legend(...)   The
legend function places a legend on various types of graphs (line
plots, bar graphs, pie charts, etc.). For each line plotted, the
legend shows a sample of the line type, marker symbol, and color
beside the text label you specify. When plotting filled areas
(patch or surface objects), the legend contains a sample of the
face color next to the text label.  The font size and font name
for the legend strings match the axes FontSize and FontName
properties.  legend('string1','string2',...) displays a legend
in the current axes using the specified strings to label each
set of data.  legend(h,'string1','string2',...) displays a
legend on the plot containing the objects identified by the
handles in the vector h and uses the specified strings to label
the corresponding graphics object (line, barseries, etc.).
legend(M) adds a legend