问题
The following function returns a plot of noise in the current version of ggmap (3.0.0):
library(ggmap)
register_google(key = "my_key")
ggmap(get_googlemap(size = c(620, 640)))
The plot appears correctly, however, when a square of any pixel dimensions is used (i.e., 640x640, 500x500, etc.). It's also worth noting that the URL returned by get_googlemap
when using non-square dimensions is valid when pasted into the web browser, so the issue seems to be in how ggmap parses and plots the URL.
I've been plotting non-square maps with get_googlemap
on a regular basis since last summer without any issues. I'm assuming I was using ggmap v2.6.1. I updated to 3.0.0 today, however, and now I'm getting the noisy plot as described.
来源:https://stackoverflow.com/questions/55908811/size-variable-in-ggmaps-get-googlemap-no-longer-seems-to-work