I am trying to change the transparency of the flow elements of an alluvial plot. I know I should change the value of 'alpha' but I am not sure where in the code I have to add this parameter. The following is my code:
library(ggplot2)
library(ggalluvial)
ggplot(sp.alluvial, aes(x = stage, stratum = state, alluvium = pks, fill = state, label = state)) +
scale_fill_brewer(type = "qual", palette = "Set2") +
geom_flow(stat = "alluvium", lode.guidance = "frontback", aes(fill = state), aes.flow = "backward") +
geom_stratum() +
theme(legend.position = "bottom", axis.text.y = element_blank(), axis.ticks.y = element_blank())
I have tried the next options:
geom_flow(stat = "alluvium", lode.guidance = "frontback", aes(fill = state), aes.flow = "backward", alpha = 0.6)
geom_flow(stat = "alluvium", lode.guidance = "frontback", aes(fill = state, alpha = 0.6), aes.flow = "backward")
and
+ geom_density(alpha = 0.6)
Any ideas?
Thanks!