我正在尝试使用绘制世界地图ggplot.我的代码在我的gist文件中.我不使用时输出正确coord_map但我使用时非常奇怪coord_map:
ggplot(data = test, aes(fill = x)) +
geom_map(aes(map_id = id), map =world.ggmap, color = "white") +
expand_limits(x = world.ggmap$long, y = world.ggmap$lat) +
theme_tufte() +
coord_map()
Run Code Online (Sandbox Code Playgroud)

ggplot(data = test, aes(fill = x)) +
geom_map(aes(map_id = id), map =world.ggmap, color = "white") +
expand_limits(x = world.ggmap$long, y = world.ggmap$lat) +
theme_tufte()
Run Code Online (Sandbox Code Playgroud)

当我使用maps包中的数据时,我遇到了同样的错误:
library(ggplot2)
library(maps)
world <- map_data("world")
ggplot() +
geom_map( data=world, aes(x=long, y=lat, group = group, map_id = region),colour="white", fill="grey10", …Run Code Online (Sandbox Code Playgroud)