Skip to content

alpha should work on line geom_sf() #3589

Closed

Description

@yutannihilation
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)

Activity

  1. yutannihilation commented on Oct 27, 2019

    @yutannihilation
    MemberAuthor

    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])

  2. thomasp85 commented on Nov 4, 2019

    @thomasp85
    Member

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

  3. added a commit that references this issue on Nov 6, 2019
    ebf88ca
  4. lock commented on May 5, 2020

    @lock

    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/

  5. locked and limited conversation to collaborators on May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions