addpoints

Appends points to an animated line.

Category: Graphics > 2-D and 3-D Plots

Syntax

addpoints(h, x, y)

Adds the points (x, y) to animated line h.

addpoints(h, x, y, z)

Adds 3-D points.

Description

The new points go after the existing ones. If the line has a MaximumNumPoints limit, the oldest points fall off the front. Call drawnow inside a loop to see the line grow, and getpoints to read the stored data.

Input arguments

h
Handle returned by animatedline.
x, y, z
Scalars or vectors of the same length.

Example

Append vectors

h = animatedline;
addpoints(h, 1:3, [4 5 6]);
addpoints(h, 4, 7);
[x, y] = getpoints(h);
disp([x; y])
Output
     1     2     3     4
     4     5     6     7

See also

animatedline clearpoints getpoints drawnow