Main Content

getline

Select polyline with mouse

getline is not recommended. Use one of the ROI classes instead, described in Create ROI Shapes.

Description

[xi,yi] = getline lets you select a polyline in the current figure using the mouse. When you finish selecting the polyline, getline returns the coordinates of the polyline endpoints in xi and yi.

Use normal button clicks to add points to the polyline. A shift-, right-, or double-click adds a final point and ends the polyline selection. Pressing Return or Enter ends the polyline selection without adding a final point. Pressing Backspace or Delete removes the previously selected point from the polyline.

[xi,yi] = getline(fig) lets you select a polyline in the current axes of figure fig, using the mouse.

[xi,yi] = getline(ax) lets you select a polyline in axes ax, using the mouse.

[xi,yi] = getline(___,'closed') animates and returns a closed polygon.

Input Arguments

collapse all

Figure handle, specified as a handle.

Axes handle, specified as a handle.

Output Arguments

collapse all

x-coordinates of selected polyline endpoints, returned as a numeric vector.

Data Types: double

y-coordinates of selected polyline endpoints, returned as a numeric vector.

Data Types: double

Version History

Introduced before R2006a

See Also

| |