Line style, marker symbol, and color, specified as a string. The elements of the string can appear in any order, and you can omit one or more options from the string specifier. If you omit the line style and specify the marker character, then the plot shows only the marker and no line.
If Y is a matrix and you specify a color with LineSpec, then all lines are plotted using the specified color. If you specify a marker type or line style and do not specify a color, then MATLAB cycles through the predefined color order.
Example: '--or' is a red dashed line with circle markers
Specifier | Line Style |
---|---|
- | Solid line (default) |
-- | Dashed line |
: | Dotted line |
-. | Dash-dot line |
Specifier | Marker |
---|---|
o | Circle |
+ | Plus sign |
* | Asterisk |
. | Point |
x | Cross |
s | Square |
d | Diamond |
^ | Upward-pointing triangle |
v | Downward-pointing triangle |
> | Right-pointing triangle |
< | Left-pointing triangle |
p | Pentagram |
h | Hexagram |
Specifier | Color |
---|---|
yellow | |
magenta | |
cyan | |
red | |
green | |
blue | |
white | |
black |