I have a map of the US county boundaries. The small section of Alaska that falls in the Eastern Hemisphere is showed at the right of the map, distorting the plot. I would like to explore options to re-center the map without losing that section.
I downloaded the US county (year: 2021, scale: 1:500k) boundaries shapefile from the US Census website, loaded in R using st_read()
, and excluded all territories.
library(ggplot2); library(st)
shp = st_read(dsn = "cb_2021_us_county_500k/cb_2021_us_county_500k.shp")
shps_sf = shp[!(shp$STUSPS %in% c("PR","AS","GU","MP","VI")),]
ggplot()+
geom_sf(data=shps_sf) #+coord_sf(xlim=c(-175,-70))
As the image shows, a small part of Alaska is plotted in the right side of the graph, consistent with its coordinates but distorting the graph. If I use coord_sf()
I can crop the graph and re-center the map. However, I would rather not lose that area.
Is there a way to manipulate the x-axis (or other features of the plot) to re-center the map without losing that section from Alaska?
I know there are options like usmap::plot_usmap()
or tidycensus::county_laea
that take care of this issue by shifting and re-scaling Alaska, but I have another layer of points that wouldn't work with those options, so I'd prefer not to go that route.