This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Specify points with mouse


[x, y] = getpts(fig)
[x, y] = getpts(ax)
[x, y] = getpts


[x, y] = getpts(fig) lets you choose a set of points in the current axes of figure fig using the mouse. Coordinates of the selected points are returned in x and y.

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

[x, y] = getpts(ax) lets you choose points in the axes specified by the handle ax.

[x, y] = getpts is the same as [x, y] = getpts(gcf).


collapse all

Display an image using imshow.


Call getpts to choose points interactively in the displayed image using the mouse. Double-click to complete your selection. When you are done, getpts returns the coordinates of your points.

[x, y] = getpts

See Also


Introduced before R2006a

Was this topic helpful?