Discussion:
Cannot remove grid lines when plotting with geom_sf()
Victor Yuan
2018-06-20 23:50:51 UTC
Permalink
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()
```

<Loading Image...>
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Adriano Fantini
2018-06-21 05:39:04 UTC
Permalink
See: https://github.com/tidyverse/ggplot2/issues/2071

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


Adriano Fantini
Post by Victor Yuan
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.
```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()
```
<https://lh3.googleusercontent.com/-COUH9m2aivw/WyroVAZ8vXI/AAAAAAAAMDM/gQ7yUvqSbFM4FnykG8Czl9VVnSi1n5iqQCLcBGAs/s1600/Rplot.png>
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
https://github.com/hadley/devtools/wiki/Reproducibility
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
For more options, visit https://groups.google.com/d/optout.
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Victor Yuan
2018-06-21 06:24:40 UTC
Permalink
Thanks, I'll check it out.
Post by Adriano Fantini
See: https://github.com/tidyverse/ggplot2/issues/2071
By the way the above link was the first result if searching for "geom sf
remove gridlines ggplot" in google ;)
Adriano Fantini
Post by Victor Yuan
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.
```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()
```
<https://lh3.googleusercontent.com/-COUH9m2aivw/WyroVAZ8vXI/AAAAAAAAMDM/gQ7yUvqSbFM4FnykG8Czl9VVnSi1n5iqQCLcBGAs/s1600/Rplot.png>
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
https://github.com/hadley/devtools/wiki/Reproducibility
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
For more options, visit https://groups.google.com/d/optout.
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...