getpoints

Returns the coordinates of the points stored in an animated line.

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

Syntax

[x, y] = getpoints(h)

Returns the x and y coordinates of the animated line h.

[x, y, z] = getpoints(h)

Also returns the z coordinates of a 3-D animated line.

Description

An animated line grows as points are added to it with addpoints. getpoints reads the points back, which is useful when the data was produced inside a loop and not kept in a variable. clearpoints empties the line.

Input arguments

h
Handle created by animatedline.

Output arguments

x, y, z
Coordinates of the points added so far with addpoints.

Example

Read back the points

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

     1     2     3
y = 1×3

     4     5     6

See also

animatedline addpoints clearpoints plot