ggmap icon indicating copy to clipboard operation
ggmap copied to clipboard

Non square maps plot incorrectly using ggmap()

Open lukeloken opened this issue 4 years ago • 0 comments

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)

map1

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)

map2

In the second example, the image is downloaded as a square size=c(500,500). It plots correctly.

lukeloken avatar May 28 '20 15:05 lukeloken