rggplot2

Projection of world map (Northern Hemisphere part) in R (Arctic Polar Stereographic)


I want to plot a polar projected Northern Hemisphere map (Arctic Polar Stereographic,EPSG:3995) using ggplot2 in R, where the basemap extent needs to be above 20 degrees north latitude.But the map always fails to display correctly after changing the projection. I've checked multiple projections but can't find the problem.

this is my attempt

library(rnaturalearth)
library(ggplot2)
library(sf)
worldmap <- ne_countries(scale = 'medium', type = 'map_units',
                         returnclass = 'sf')
worldmap_trans <- st_transform(worldmap, st_crs(3995))
ggplot()+
  geom_sf(data = worldmap)
ggplot()+
  geom_sf(data = worldmap_trans)

Before projection transformationAfter projection transformation


Solution

  • Based on this GIS Stack Exchange post, using coord_sf() with sf::st_crs("ESRI:102016") does what I think you are looking for and works with either projection of world map.

    ggplot()+
      geom_sf(data = worldmap)+
      coord_sf(crs = sf::st_crs("ESRI:102016"))
    
    ggplot()+
      geom_sf(data = worldmap_trans)+
      coord_sf(crs = sf::st_crs("ESRI:102016"))