绘制 sf 对象时如何避免 ggplot2 将轴转换为度数?

How to avoid ggplot2 to convert axis to degrees when ploting sf objects?

我正在使用 ggplot2 绘制投影多边形 (sf) 对象。当我使用它时,ggplot 将轴绘制为度数 (north/south - east/west),但我更喜欢它保持轴为北向东(这是正确的)。

这是一个例子:

library(rnaturalearth)
library(ggplot2)
library(sf)

# Get world polygons
world <- ne_countries()

# Reproject to equal area lambers projection
proj <- "+proj=laea +lat_0=0 +lon_0=-70 +x_0=0 +y_0=0 +datum=WGS84 +units=km +no_defs"
world_proj <- spTransform(world, CRS(proj))

# Convert to sf
world_proj <- st_as_sf(world_proj)

# Plot it --- showing correctly as easting-northing
plot(world_proj, axes = T, max.plot = 1,
     xlim = c(-3200, 4500), ylim = c(-4900, 4900))

# Plot with ggplot - converting to degrees north/south - west/east
# I need it in north easting!
ggplot()+
        geom_sf(data = world_proj)+
        coord_sf(xlim = c(-3200, 4500), ylim = c(-4900, 4900))

我试图更改 coord_sf 上的参数,但没有帮助。感谢您提供的任何建议!

更改 datum 参数:

 ggplot()+
         geom_sf(data = world_proj)+
         coord_sf(xlim = c(-3200, 4500), ylim = c(-4900, 4900), 
         datum=st_crs(world_proj))

文档:

   datum: CRS that provides datum to use when generating graticules.