manipulatorMouseClick()
deviceX |
Device X coordinate (expressed in pixels) |
deviceY |
Device Y coordinate (expressed in pixels) |
userX |
User X coordinate (expressed in plot x units). Note that this value is only valid for base graphics. |
userY |
User Y coordinate (expressed in plot y units). Note that this value is only valid for base graphics. |
ndcX |
NDC X coordinate (0 to 1 from left to right) |
ndcY |
NDC Y coordinate (0 to 1 from bottom to top) |
If a mouse click did not cause the current invocation of the manipulate expression (e.g. if it was caused by the user changing the value of a control) then the function returns NULL.
The mouse click coordinates are provided in device, user, and ndc coordinates. To convert these coordinates into other coordinate systems (e.g. cm or npc) you can use the grconvertX
and grconvertY
functions.
Note that the userX and userY coordinates are only applicable for base graphics plots (they are not applicable for grid, lattice, ggplot, etc). Therefore, for non-base graphics the userX and userY values will not contain valid coordinates.
manipulate
, grconvertX
, grconvertY