Identify points in a plot using a formula.

Description

Reads the position of the graphics pointer when the (first) mouse button is pressed, searches the coordinates given in x and y for the point closest to the pointer, and return the index if this point is close enough to the pointer.