Non-square (rectangular) maps in R-ggmap

笑着哭i 提交于 2019-12-04 07:32:37

If you can live without Google Maps, there are easy, immediate alternatives (I'd've included CloudMade but I don't have an enterprise account):

library(ggmap)

loc <- c(-96, 29.4, -94, 30.2)

# gmaps

tx_map_gmaps <- get_map(location=loc, source="google", maptype="terrain")
gg <- ggmap(tx_map_gmaps)
gg

# openstreetmap

tx_map_osm <- get_map(location=loc, source="osm")
gg <- ggmap(tx_map_osm)
gg

# stamen

tx_map_stamen <- get_map(location=loc, source="stamen", maptype="toner")
gg <- ggmap(tx_map_stamen)
gg

And, if you're willing to fiddle with initial zoom settings & then cropping (and, perhaps, some tile graininess), you can do it with Google Maps:

tx_map_gmaps <- get_map(location=loc, source="google", maptype="terrain")
gg <- ggmap(tx_map_gmaps)
gg <- gg + scale_y_continuous(limits=c(29.5, 30.0))
gg

(I didn't fiddle with said initial zoom, but you shld be able to get the idea.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!