I am trying to use the solution here for applying a bounding box of coordinates when plotting a ggmap, as specifying get_map() using a bounding box does not work (is converted to center and zoom).
However, I end up with a lot of extra gray around my plot. I would like to have a plot fitted nicely where the bounding coordinates are (xmin, xmax, ymin, ymax) = (-170,-30, -60, 110)
# Get a Google satellite map of North and South America
map <- get_map(location = c(-100, 20), zoom = 2, maptype = "satellite", source = "google")
ggmap(map)
I would like to have a plot fitted to the coordinates described above.
# Attempt to scale the x and y axes
ggmap(map) +
scale_x_continuous(limits = c(-170, -30), expand=c(0,0)) +
scale_y_continuous(limits = c(-60, 110), expand=c(0,0))
What I end up with is a plot that looks like this:
Cropped nicely but with excessive gray space at the top.
Edit: I used R 3.3.3 in RStudio 1.0.136, with ggmap 2.7 and ggplot2 2.2.0