Skip to content

Cannot remove panel.grid (graticules) from ggplot + geom_sf() #2071

@tiernanmartin

Description

@tiernanmartin

I would like to completely remove the graticule lines from my plot, but it is unclear which argument in theme() controls the graticule lines.

Reprex

library(sf) 
library(ggplot2)

nc = st_read(system.file("gpkg/nc.gpkg", package = "sf")) 

ggplot(nc) + 
  geom_sf(data = nc, aes(fill = AREA)) + 
  coord_sf(crs = st_crs(nc)) + 
  theme(
    panel.ontop = TRUE,   ## Note: this is to make the panel grid visible in this example
    panel.grid = element_blank(), 
    line = element_blank(), 
    rect = element_blank(), 
    text = element_blank(), 
    plot.background = element_rect(fill = "black"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorthemes 💃

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions