Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201919

fs full extent R graphics device

$
0
0

I am starting to explore the sf package and have a question about geom_sf(). All of my spatial plots render nicely filling the complete R plotting device, however, when I use geom_sf() in ggplot2 it renders the shapefile in the middle and having a lot of white space above and below the plot. Is there an argument inside geom_sf() to make the shapefile fit the entire R window device?

See pic below:

library(ggplot2)
library(sf)
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
ggplot(nc) + geom_sf(size = 0.05)

enter image description here


Viewing all articles
Browse latest Browse all 201919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>