Graphics    

Specifying Line Style

You can assign different line styles to each data set by passing line style identifier strings to plot. For example,

Colors, Line Styles, and Markers

The basic plotting functions accepts character-string arguments that specify various line styles, marker symbols, and colors for each vector plotted. In the general form,

linestyle_marker_color is a character string (delineated by single quotation marks) constructed from:

For example,

plots a yellow dotted line and places square markers at each data point. If you specify a marker type, but not a line style, MATLAB draws only the marker.

The specification can consist of one or none of each specifier in any order. For example, the string,

defines a dashed line with circular markers, both colored green.

You can also specify the size of the marker and, for markers that are closed shapes, you can specify separately the color of the edges and the face.

See the LineSpec discussion for more information.


  Creating Line Plots Specifying the Color and Size of Lines