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. For example, these statements plot three related functions of x
, each curve in a separate distinguishing color.
The legend
command provides an easy way to identify the individual plots.
Creating a Plot | Specifying Line Styles and Colors |