Hi suppose I have a figure like this. I don't care about the y-axis per se, however what I want is to have spaces in between each category, for example each response would be nice if it was seperated with a white space? I have a figure below with red drawing to illustrate what I mean. Is this possible? Data is loaded from the package.
data(vaccinations)
vaccinations$response <- factor(vaccinations$response,
rev(levels(vaccinations$response)))
# annotate with proportional counts
ggplot(vaccinations,
aes(x = survey, stratum = response, alluvium = subject,
y = freq, fill = response)) +
geom_lode() + geom_flow(curve_type = "cubic") +
geom_stratum(alpha = 0) +
geom_text(stat = "stratum", aes(label = round(after_stat(prop), 3))) +
theme(axis.title.y=element_blank(),
axis.text.y=element_blank(),
axis.ticks.y=element_blank())
What I also tried is to increase the space between between the stacks however when I do that the flow does not align with the stack.
ggplot(vaccinations,
aes(x = survey, stratum = response, alluvium = subject,
y = freq, fill = response)) +
geom_flow(curve_type = "cubic", knot.pos = FALSE, segments=3, lwd=10 ) +
geom_stratum(alpha = 0, lwd=10, color="white" ) +
geom_text(stat = "stratum", aes(label = round(after_stat(prop), 3))) +
theme(axis.title.y=element_blank(),
axis.text.y=element_blank(),
axis.ticks.y=element_blank())