LineSpec
Purpose
Line specification syntax
Description
LineSpec
is not a command. It refers to the three components used to specify linestyles in MATLAB :
The line type, marker symbol, and color are MATLAB strings that specify a line style. You create a one-, two-, three-, or four-character string from the characters in the following table. The LineSpec argument to the plot command can contain up to one element from each column. Each element of the Axes LineStyleOrder property can contain up to one element from each of the first two columns (but can not contain Color). The order of characters is unimportant.
The LineStyle properties of Line, Surface, and Patch, and the GridLineStyle property of Axes are specified using symbols in the first column, while the Marker properties of Line, Surface, and Patch are specified with symbols from the second column.
Line Style
| Marker Symbol
| Color
|
---|
-
| solid line
|
.
| point
|
y
|
yellow
|
:
| dotted line
|
o
| circle
|
m
|
magenta
|
-.
| dashdot line
|
x
| cross
|
c
|
cyan
|
--
| dashed line
|
+
| plus
|
r
|
red
|
|
|
*
| asterisk
|
g
|
green
|
|
|
s
|
square
|
b
|
blue
|
|
|
d
|
diamond
|
w
|
white
|
|
|
^
|
up arrow
|
k
|
black
|
|
|
v
|
down arrow
|
|
|
|
|
>
|
right arrow
|
|
|
|
|
<
|
left arrow
|
|
|
|
|
p
|
pentagram
|
|
|
|
|
h
|
hexagram
|
|
|
Examples
Create a plot that displays an asterisk at each point and connects the points with solid blue lines:
plot(rand(10,1),'-
*b')
See Also
line, plot, surface, patch, Axes LineStyleOrder.
[ Previous | Help Desk | Next ]