Is there a way to remove the ample white space around choropleth maps without saving the plot?
nc = sf::st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
ggplot2::ggplot(nc) +
ggplot2::geom_sf(ggplot2::aes(fill = SID79))
Created on 2024-12-19 with reprex v2.1.1
I learned from a StackOverflow answer, that one could resize the window to remove whitespace. But the code for doing this is missing. I tried it with negative parameters in the plot.margin
line but failed. I also failed with tips from another SO post.
2