
3 Graphics
• Line style strings are '-' for solid, '--' for dashed, ':' for dotted, and
'-.' for dash-dot. Omit the line style for no line.
• The marker types are
'+', 'o', '*',and'x', and the filled marker types
are
's' for squar e, 'd' for diamond, '^ ' for up tria ng le, '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 “E diting
Plots” on pag e 3-17 for more information.
Plotting Lines and Markers
If you specify a marker type but not a line style, MATLAB draws only the
marker. For example,
plot(x,y,'ks')
plots black squares a t each data point, but does not connect the markers
with a line.
The statement
plot(x,y,'r:+')
plots a red dotted line and places plus sign markers at each data point.
Placing Markers at Every Tenth Data Point
You might want to use fewer data points to plot the markers than you use to
plot the lines. This example plots the data twice using a different number of
points for the dotted line and marker plots:
x1 = 0:pi/100:2*pi;
x2 = 0:pi/10:2*pi;
plot(x1,sin(x1),'r:',x2,sin(x2),'r +')
3-52
Commenti su questo manuale