It shows a sample of the linestyle used for each plot line, obtaining this information from the plot. Each linetype must be a valid line style string as for the plot function. To move a legend box, hold down the left mouse button and drag the box to a new location.
Examples Add a legend to a simple plot.
When the legend box is the current axes, the figure window is not redrawn. To force a redraw, use the refresh command. Copyright 1994 by The MathWorks, Inc.