ggmap
ggmap copied to clipboard
Non square maps plot incorrectly using ggmap()
Reproducible Example
library(ggmap)
register_google(key = as.character(GoogleAPIkey))
#rectangle
map_1<-get_googlemap(center=c(-121.57,38.51), size=c(250, 500), zoom = 12, scale=2, maptype = "satellite", key=GoogleAPIkey )
ggmap(map_1)
In the first example, the image appears twice and is compressed along the x-axis. It was downloaded using a rectangle size=c(250,500)
. Also notice that the longitude axis labels appear as they should.
#square
map_2<-get_googlemap(center=c(-121.57,38.51), size=c(500, 500), zoom = 12, scale=2, maptype = "satellite", key=GoogleAPIkey )
ggmap(map_2)
In the second example, the image is downloaded as a square size=c(500,500)
. It plots correctly.