Getting Started Previous page   Next Page

Multiple Data Sets in One Graph

Multiple x-y pair arguments create multiple graphs with a single call to plot. MATLAB automatically cycles through a predefined (but user settable) list of colors to allow discrimination among sets of data. See the axes ColorOrder and LineStyleOrder properties.

For example, these statements plot three related functions of x, with each curve in a separate distinguishing color:

The legend command provides an easy way to identify the individual plots:


Previous page  Creating a Plot Specifying Line Styles and Colors Next page

© 1994-2005 The MathWorks, Inc.