Skip to content
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

alpha should work on line geom_sf() #3589

Closed
yutannihilation opened this issue Oct 27, 2019 · 3 comments · Fixed by #3608
Closed

alpha should work on line geom_sf() #3589

yutannihilation opened this issue Oct 27, 2019 · 3 comments · Fixed by #3608

Comments

@yutannihilation
Copy link
Member

@yutannihilation yutannihilation commented Oct 27, 2019

library(ggplot2)
library(sf)
#> Linking to GEOS 3.7.2, GDAL 3.0.1, PROJ 6.2.0

d <- data.frame(x = 1:5, y = 1:5)

l <- st_linestring(as.matrix(d))
sf <- st_sf(geometry = st_sfc(l))

p1 <- ggplot(d, aes(x, y)) + geom_line(alpha = 0.1) + ggtitle("geom_line()")
p2 <- ggplot(sf) + geom_sf(alpha = 0.1) + ggtitle("geom_sf()")

patchwork::wrap_plots(p1, p2)

Created on 2019-10-27 by the reprex package (v0.3.0)

@yutannihilation
Copy link
Member Author

@yutannihilation yutannihilation commented Oct 27, 2019

I'll fix this when #3546 gets merged. It would be easy as just adding | is_line here:

col[is_point] <- alpha(col[is_point], alpha[is_point])

@thomasp85
Copy link
Member

@thomasp85 thomasp85 commented Nov 4, 2019

yeah - that is an oversight on my part. Good catch, and your fix should work nicely

yutannihilation added a commit that referenced this issue Nov 6, 2019
Apply alpha to linestring geometries in geom_sf(). Fix #3589
@lock
Copy link

@lock lock bot commented May 5, 2020

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/

@lock lock bot locked and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants