Cannot remove grid lines when plotting with geom_sf()

310 views
Skip to first unread message

Victor Yuan

unread,
Jun 20, 2018, 9:19:19 PM6/20/18
to ggplot2
Hi I'm trying to get rid of gridlines from my map plots. I've tried various themes: ggmaps::theme_nothing(), theme_void(), theme_classic(), but they all return really black grid lines, and I'm not sure why. These themes work fine when I am plotting a non-geom_sf() layer.

Here is a short reproducible example:

```r
library(maps)
library(sf)
library(ggplot2)
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
ggplot() +
  geom_sf(data = nc) +
  theme_void()
```


Adriano Fantini

unread,
Jun 21, 2018, 1:39:52 AM6/21/18
to victo...@gmail.com, ggplot2

By the way the above link was the first result if searching for "geom sf remove gridlines ggplot" in google ;)


Adriano Fantini


--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Victor Yuan

unread,
Jun 21, 2018, 2:25:01 AM6/21/18
to Adriano Fantini, ggplot2
Thanks, I'll check it out. 
Reply all
Reply to author
Forward
0 new messages