This function is a wrapper of grid::grid.locator()
, and provides a way to
find the coordinates of a vertex in the current plot. It is useful to
identify the vertex that is being clicked in a plot.
locate_vertex(x = NULL)
x | An object of class |
---|
A list with the name of the vertex, the x and y coordinates and the viewport where it is located.
This function only works in interactive mode. Once it is called,
the user can click on a vertex in the plot. The function will return the
name of the vertex, the x and y coordinates and the viewport where it is
located. If x
is not specified, the last plotted netplot
object will be
used.
#> #>#>#> #>#>#> #>#>#> #># Clicking (only works in interactive mode) if (interactive()) { res <- locate_vertex() print(res) }