-
Notifications
You must be signed in to change notification settings - Fork 99
drawPolyline
David Legland edited this page Feb 28, 2022
·
1 revision
Draw a polyline specified by a list of points.
drawPolyline(COORD);
packs coordinates in a single [N*2] array.
drawPolyline(PX, PY);
specifies coordinates in separate arrays. PX and PY must be column vectors with the same length.
drawPolyline(..., TYPE);
where TYPE is either 'closed' or 'open', specifies if last point must be connected to the first one ('closed') or not ('open'). Default is 'open'.
drawPolyline(..., PARAM, VALUE);
specify plot options as described for plot command.
H = drawPolyline(...)
also return a handle to the list of line objects.
Draw a curve representing an ellipse
t = linspace(0, 2*pi, 100)';
px = 10*cos(t); py = 5*sin(t);
drawPolyline([px py], 'closed');
axis equal;
The same, with different drawing options
drawPolyline([px py], 'closed', 'lineWidth', 2, 'lineStyle', '--');