Sankey Plot / Alluvial Flow Diagram

版本 1.0.0 (3.7 KB) 作者: Roman Kuster
Function to create a sankey plot / alluvial flow diagram to visualise the group membership and its change over time.
191.0 次下载
更新时间 2021/6/24

查看许可证

Function to create a sankey plot / alluvial flow diagram with numerical data stored in InputData (e.g. categories 0, 1, and 2). Each row in InputData represents a subject, and each column represents a timepoint. The entries in InputData reflect the group a particular subject was assigned to at a particular timepoint, and the plot visualises the flow of group membership over all timepoints.
- size(InputData,1) corresponds to the number of subjects
- size(InputData,2) corresponds to the number of timepoints
- entries represent the category a subject belongs to at a given timepoint
Example Data with 5 subjects, 4 timepoints, and 3 categories: InputData = [0,0,1,0;2,1,2,2;1,1,0,1;0,1,1,2;1,2,2,2];
The highest category (2 in example data) is assigned to the top bar, the lowest category to the bottom bar. Can be modified by change the order in categories. The bars are coloured from green (top) to red (bottom), and the percentage of subjects belonging to each category is indicated in the middle of the bar.
Function calls the modified function sankey_alluvialflow initially written by Alexander Carmeli (Alluvial flow diagram, available from: www.mathworks.com/matlabcentral/fileexchange/66746-alluvial-flow-diagram) and modified by Ranran Wang (Sankey Diagram, available from: www.mathworks.com/matlabcentral/fileexchange/75813-sankey-diagram).

引用格式

Roman Kuster (2024). Sankey Plot / Alluvial Flow Diagram (https://www.mathworks.com/matlabcentral/fileexchange/94775-sankey-plot-alluvial-flow-diagram), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2019a
兼容任何版本
平台兼容性
Windows macOS Linux
标签 添加标签
致谢

参考作品: Sankey Diagram, Alluvial flow diagram

启发作品: Sankey flow chart

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0