Learn R Programming

ggmap (version 2.6.1)

gglocator: Locator for ggplots.

Description

Locator for ggplots. (Note : only accurate when extent = "normal" when using ggmap.)

Usage

gglocator(n = 1, message = FALSE, xexpand = c(0.05, 0),
  yexpand = c(0.05, 0))

Arguments

n

number of points to locate.

message

turn messaging from grid.ls on/off

xexpand

expand argument in scale_x_continuous

yexpand

expand argument in scale_y_continuous

Value

a data frame with columns according to the x and y aesthetics

Examples

Run this code
# NOT RUN {
if(interactive()){

# only run for interactive sessions


df <- expand.grid(x = 0:-5, y = 0:-5)
(p <- qplot(x, y, data = df) +
  annotate(geom = 'point', x = -2, y = -2, colour = 'red'))
gglocator()

p +
  scale_x_continuous(expand = c(0,0)) +
  scale_y_continuous(expand = c(0,0))
gglocator(1, xexpand = c(0,0), yexpand = c(0,0))


}


# }

Run the code above in your browser using DataLab