I have several maps I created using geom_spatvector and am joining them together with patchwork::wrap_plots(). In some cases the x-axis labels (on an individual plot) overlap with each other. I would like to have fewer labels so that they do not overlap.
I tried to apply the solution here:
/a/59725111/5652841
Is there a way to do this?
library(ggplot2)
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
# starting point
ggplot(nc) +
geom_sf()
# I would like to get fewer x-axis labels (fewer ticks is okay too)
# I tried this, but I still get the default amount of breaks
ggplot(nc) +
geom_sf(inherit.aes = FALSE) +
scale_x_continuous(n.breaks = 2)
# If I manually specify the breaks then I can get something similar to what I am looking for
# Is there an easy way to do this without needing to specify the breaks for each plot?
ggplot(nc) +
geom_sf(inherit.aes = FALSE) +
scale_x_continuous(breaks = c(-84, 76))