Getting Started |
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:
For More Information See Defining the Color of Lines for Plotting in "Axes Properties" in the MATLAB documentation. |
Creating a Plot | Specifying Line Styles and Colors |
© 1994-2005 The MathWorks, Inc.