-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Point symbols do not appear in the legend [geom_sf] #3572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Apparently the legend type is hardcoded and is not auto-detected: Line 185 in 9870890
Manually setting it to "point" works, but if we could add auto-detection that would be great. library("sf")
#> Linking to GEOS 3.7.2, GDAL 2.4.2, PROJ 5.2.0
library("ggplot2")
df = data.frame(x = 1:2, y = 1:2, val = 3:4, shape = factor(1:2))
df = st_as_sf(df, coords = c("x", "y"), crs = 27700)
ggplot(df) +
geom_sf(aes(color = val, shape = shape), show.legend = "point") Created on 2019-10-16 by the reprex package (v0.3.0) |
With current ggplot2 master: library("sf")
#> Linking to GEOS 3.7.2, GDAL 2.4.2, PROJ 5.2.0
library("ggplot2")
df = data.frame(x = 1:2, y = 1:2, val = 3:4, shape = factor(1:2))
df = st_as_sf(df, coords = c("x", "y"), crs = 27700)
ggplot(df) +
geom_sf(aes(color = val, shape = shape)) Created on 2019-12-06 by the reprex package (v0.3.0) |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
I chose point symbols, they appeared on the map, but didn't appear in the legend.
The text was updated successfully, but these errors were encountered: