Plot border gets behind sf element in ggplot2
The issue is that you have used plot.background
, which is drawn before the geom, rather than panel.border
, which is drawn after. Try:
pb %>%
ggplot(aes(fill = couv_rappel)) +
geom_sf() +
theme_void() +
theme(panel.border = element_rect(colour = "red", fill=NA, size = 2),
legend.position = "none") +
xlim(2.3,2.4)