You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 NAs 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")
The text was updated successfully, but these errors were encountered:
Closed too soon. When trying to translate that solution (for geom_raster()) back to geom_stars(), I get this error:
Error: Aesthetics must be valid data columns. Problematic aesthetic(s): fill = stage(...).
Did you mistype the name of a data column or forget to add after_stat()?
I can modify the reprex above or post a new one here as soon as I can (not immediately), if that's helpful.
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(...)
ingeom_stars()
✅ Rendering
NA
s as fully transparent also works by itself, viana.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
The text was updated successfully, but these errors were encountered: