Closed mw55309 closed 1 year ago
Hi @mw55309 and thanks for checking! I don't remember if this is explicitly documented anywhere, and maybe it should be mentioned in the vignette with this example. I believe it's due to the difference between the choices of width
for the alluvia versus for the strata. If you set them to the same value, do they match?
Yes, that fixes it, thank you!
ggplot(as.data.frame(Titanic),
aes(y = Freq,
axis1 = Survived, axis2 = Sex, axis3 = Class)) +
geom_alluvium(aes(fill = Class),
width = 1/8, knot.pos = 0, reverse = FALSE) +
guides(fill = FALSE) +
geom_stratum(width = 1/8, reverse = FALSE) +
geom_text(stat = "stratum", aes(label = after_stat(stratum)),
reverse = FALSE) +
scale_x_continuous(breaks = 1:3, labels = c("Survived", "Sex", "Class")) +
coord_flip() +
ggtitle("Titanic survival by class and sex")
It may be worthwhile updating the vignette?
Sure, i'll leave this issue open as a reminder for the next time i revise the package.
Good to know that it worked, thanks!
Resolved in 0b71a4d3e5de93a9db2a9c7491424c43d21f3449, i think!
Description of the issue
I'm sorry if this has been mentioned before, but the flows overlap the boundaries of the columns and I am not sure why, even in thee Titanic example
Reproducible example (preferably using
reprex::reprex()
)If you look at the purple (far right) flow between "Crew" and "Male", it clearly overlaps the boundary between "3rd" and "Crew", then also between "Male" and "Female".
The flows overlap the boundaries in multiple locations.