Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upstrata label positions #27
Comments
|
The root problem here is that the At present, i think the only way to do what you're after is to manipulate the data frame itself to create a new column of labels, some of which are blank...and this would only work for data in long format. But it seems like a general enough need to make it a feature. I'll try to get to this within the next couple of weeks. Thanks for pointing this out! |
|
Thank you for fast replay and this great package. I'll try this solution. |
|
|
Description of the issue
After subsetting text labels of the strata in order to lessen the number of labels they are changing positions.
Reproducible example (preferably using
reprex::reprex())ggplot(data = titanic_wide,
aes(axis1 = Class, axis2 = Sex, axis3 = Age,
y = Freq)) +
scale_x_discrete(limits = c("Class", "Sex", "Age"), expand = c(.1, .05)) +
xlab("Demographic") +
geom_alluvium(aes(fill = Survived)) +
geom_stratum() + geom_text(data = subset(titanic_wide, Freq > 200), stat = "stratum", label.strata = TRUE) +
theme_minimal() +
ggtitle("passengers on the maiden voyage of the Titanic",
"stratified by demographics and survival")