Getting Started | ![]() ![]() |
Specifying Line Styles and Colors
It is possible to specify color, line styles, and markers (such as plus signs or circles) when you plot your data using the plot
command:
color_style_marker
is a string containing from one to four characters (enclosed in single quotation marks) constructed from a color, a line style, and a marker type:
'c'
, 'm'
, 'y'
, 'r'
, 'g'
, 'b'
, 'w'
, and 'k'
. These correspond to cyan, magenta, yellow, red, green, blue, white, and black.
'-'
for solid, '
--'
for dashed, ':'
for dotted, '-.'
for dash-dot. Omit the line style for no line.
'+'
, 'o'
, '*'
, and 'x'
, and the filled marker types are 's'
for square, 'd'
for diamond, '^'
for up triangle, 'v'
for down triangle, '>'
for right triangle, '<'
for left triangle, 'p'
for pentagram, 'h'
for hexagram, and none
for no marker.
You can also edit color, line style, and markers interactively. See Editing Plots for more information.
![]() | Multiple Data Sets in One Graph | Plotting Lines and Markers | ![]() |
© 1994-2005 The MathWorks, Inc.