-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsankeyDemo3.m
More file actions
47 lines (37 loc) · 1.35 KB
/
Copy pathsankeyDemo3.m
File metadata and controls
47 lines (37 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
%% sankey demo3 : Set color
figure('Name','sankey demo3-1','Units','normalized','Position',[.05,.2,.5,.56])
links={'a1','A',1.2;'a2','A',1;'a1','B',.6;'a3','A',1; 'a3','C',0.5;
'b1','B',.4; 'b2','B',1;'b3','B',1; 'c1','C',1;
'c2','C',1; 'c3','C',1;'A','AA',2; 'A','BB',1.2;
'B','BB',1.5; 'B','AA',1.5; 'C','BB',2.3; 'C','AA',1.2};
% Create a Sankey diagram object (创建桑基图对象)
SK=SSankey(links(:,1),links(:,2),links(:,3));
% Set color (设置颜色)
SK.ColorList=[0.46, 0.54, 0.46;
0.54, 0.68, 0.46;
0.41, 0.49, 0.36;
0.38, 0.53, 0.84;
0.44, 0.59, 0.87;
0.58, 0.79, 0.93;
0.65, 0.64, 0.84;
0.63, 0.63, 0.80;
0.56, 0.53, 0.67;
0.76, 0.81, 0.43;
0.56, 0.86, 0.97;
0.78, 0.59, 0.65;
0.89, 0.91, 0.53;
0.93, 0.56, 0.25;];
% Start drawing (开始绘图)
SK.draw()
%%
figure('Name','sankey demo3-2','Units','normalized','Position',[.05,.2,.5,.56])
links={'a1','A',1.2;'a2','A',1;'a1','B',.6;'a3','A',1; 'a3','C',0.5;
'b1','B',.4; 'b2','B',1;'b3','B',1; 'c1','C',1;
'c2','C',1; 'c3','C',1;'A','AA',2; 'A','BB',1.2;
'B','BB',1.5; 'B','AA',1.5; 'C','BB',2.3; 'C','AA',1.2};
% Create a Sankey diagram object (创建桑基图对象)
SK=SSankey(links(:,1),links(:,2),links(:,3));
% Set color (设置颜色)
SK.ColorList(3,:)=[0,0,0];
% Start drawing (开始绘图)
SK.draw()