tkLocator {tkRplotR}R Documentation

Gives the Position

Description

Gives the position when the left mouse button is pressed + "Ctrl" button.

Usage

tkLocator(parent, n = 1)

Arguments

parent

Tk toplevel window

n

the number of points to locate

Value

A list with x and y components which are the coordinates of the identified points.

Examples

## Not run: 
bb <- 1
tt <- tktoplevel()
tt <- tkRplot(tt, function() {
 x <- 1:20 / 20
   plot(
   x,
   x ^ bb,
   col = "#0000ff50",
       xlab = "x",
           ylab = paste0("x^", bb),
               type = "l",
                   axes = FALSE,
                       lwd = 4)
   title(main = bb)
     points(x,
      x ^ bb,
      col = "#ff000050",
      pch = 19,
      cex = 2)
        axis(1)
        axis(2)
          box()
          })
 tkLocator(tt, 2)
 
## End(Not run)


[Package tkRplotR version 0.1.7 Index]