-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Description
If this is a value in ggplot2
, I'm happy to file it there. Thanks for a wonderful package!
Summary
✅ Rendering finite values in a semi-transparent manner works by itself, via alpha = I(...)
in geom_stars()
✅ Rendering NA
s as fully transparent also works by itself, via na.value = "transparent"
in, e.g., scale_fill_viridis_c()
❌ Combining the two does not work; the former seems to "override" or obviate the latter
Smallish reprex
# Setup
library(stars)
library(ggplot2)
x <- read_stars(system.file("tif/L7_ETMs.tif", package = "stars"))
x[[1]][x[[1]] < 30] <- NA # Set some values to be NA
# This works; NAs become fully transparent
ggplot() + geom_stars(data = x) + scale_fill_viridis_c(na.value = "transparent")
# This also works as intended; everything becomes 50% transparent
ggplot() + geom_stars(data = x, alpha = I(0.5))
# The combination does not work---NAs become white instead of fully transparent
ggplot() + geom_stars(data = x, alpha = I(0.5)) + scale_fill_viridis_c(na.value = "transparent")
chris31415926535
Metadata
Metadata
Assignees
Labels
No labels