12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

legendPurpose2legendDisplay a legend on graphsSyntaxDescriptionlegend('string1','string2',...)legend(h,'string1','string2',...)legend(string_matrix)legend(h,string_matrix)legend(axes_handle,...)legend('off')legend(h,...)legend(...,pos)h = legend(...)[legend_handle,object_handles] = legend(...)legend places a legend on various types of graphs (line plots, bar graphs, piecharts, 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 filledareas (patch or surface objects), the legend contains a sample of the face colornext to the text label.legend('string1','string2',...) displays a legend in the current axesusing the specified strings to label each set of data.legend(h,'string1','string2',...) displays a legend on the plotcontaining the handles in the vector h, using the specified strings to label thecorresponding graphics object (line, bar, etc.).legend(string_matrix) adds a legend containing the rows of the matrixstring_matrix as labels. This is the same aslegend(string_matrix(1,:),string_matrix(2,:),...).legend(h,string_matrix) associates each row of the matrix string_matrixwith the corresponding graphics object in the vector h.legend(axes_handle,...) displays the legend for the axes specified byaxes_handle.legend('off'),legend(axes_handle,'off') removes the legend from thecurrent axes or the axes specified by axes_hanlde.2-258

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!