小编Ann*_*ise的帖子

如何在地图(ggplot)上放置比例尺和指北针?

我正在尝试使用“ggsn”包放置比例尺和指北针。但我收到一条错误消息:

错误:annotation_custom 仅适用于笛卡尔坐标

此外: 警告消息:

1:在 min(data$long) 中:没有非缺失的 min 参数;返回信息

2:在 max(data$long) 中:没有非缺失的 max 参数;返回 -Inf

3:在 min(data$lat) 中:没有非缺失的 min 参数;返回信息

4:在 max(data$lat) 中:没有非缺失的 max 参数;返回 -Inf

5:删除了 1374840 行包含非有限值 (stat_contour)。

我的代码是这样的:

#loading the map
world <- maps::map("world2", fill=TRUE, plot=FALSE) # world2 is the Pacific centered map with longitude [0,360]

IDs <- sapply(strsplit(world$names, ":"), function(x) x[1])
world <- map2SpatialPolygons(world, IDs=IDs, proj4string=CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"))

world_map <- fortify(world)

#load the bathymetry 
bat <- marmap::getNOAA.bathy(lon1 = -5.0000, lon2 = -80.0000, lat1 …
Run Code Online (Sandbox Code Playgroud)

graphics dictionary r ggplot2

4
推荐指数
2
解决办法
925
查看次数

标签 统计

dictionary ×1

ggplot2 ×1

graphics ×1

r ×1