【发布时间】:2019-05-03 21:14:27
【问题描述】:
我想使用ggplot2 和ggalluvial 在冲积图中计算各组之间的距离
我的例子来自https://corybrunson.github.io/ggalluvial/articles/ggalluvial.html
data(vaccinations)
levels(vaccinations$response) <- rev(levels(vaccinations$response))
ggplot(vaccinations,
aes(x = survey, stratum = response, alluvium = subject,
y = freq,
fill = response, label = response)) +
scale_x_discrete(expand = c(.1, .1)) +
geom_flow() +
geom_stratum(alpha = .5) +
geom_text(stat = "stratum", size = 3) +
theme(legend.position = "none") +
ggtitle("vaccination survey responses at three points in time")
给我:
现在我想缩短 ms153_NSA 之间的距离,同时保持 ms432_NSA 和 ms460_NSA 之间的距离相同:
我尝试使用以下(没有成功):
https://rdrr.io/cran/ggalluvial/man/stat_flow.html
How to increase the space between the bars in a bar plot in ggplot2?
连googledoes not都给我看一张不对称冲积图::'-/
【问题讨论】:
-
我能够更改条间距,但每次我这样做时,其中一个间隙变得没有流动带。
标签: r ggplot2 sankey-diagram dataflow-diagram