[英]ggmap plotted with bounding coordinates
我正在尝试使用此处的解决方案在绘制ggmap时应用坐标的边界框,因为使用边界框指定get_map()无效(转换为中心和缩放)。
但是,最终我的绘图周围有很多多余的灰色。 我想很好地拟合边界坐标为(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)
我想将一个图拟合到上述坐标。
# 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))
裁剪效果很好,但顶部有过多的灰色空间。
编辑:我在RStudio 1.0.136中使用R 3.3.3,以及ggmap 2.7和ggplot2 2.2.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.