Navigation

Operators and Keywords

Function List:

C++ API

: [x, y, buttons] = ginput (n)
: [x, y, buttons] = ginput ()

Return the position and type of mouse button clicks and/or key strokes in the current figure window.

If n is defined, then capture n events before returning. When n is not defined ginput will loop until the return key RET is pressed.

The return values x, y are the coordinates where the mouse was clicked in the units of the current axes. The return value button is 1, 2, or 3 for the left, middle, or right button. If a key is pressed the ASCII value is returned in button.

Implementation Note: ginput is intenteded for 2-D plots. For 3-D plots see the currentpoint property of the current axes which can be transformed with knowledge of the current view into data units.

See also: gtext, waitforbuttonpress.

Package: octave