-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdemo16_6_XYT_45_Block_GS.m
More file actions
30 lines (27 loc) · 1.22 KB
/
Copy pathdemo16_6_XYT_45_Block_GS.m
File metadata and controls
30 lines (27 loc) · 1.22 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
%% Rotated triangular heatmap with Group Block and GroupSep
rng(2)
% Made up some data casually (随便捏造了点数据)
X = randn(20, 12) + [(linspace(-1, 2.5, 20)').*ones(1, 5), ...
(linspace(.5, -.7, 20)').*ones(1, 3),...
(linspace(.9, -.2, 20)').*ones(1, 4)];
[Data, pval] = corr(X);
group = [1,1,1,1,1,2,2,2,3,3,3,3];
labels = compose('Slan-%d', 1:12);
gnames = {'Group-A', 'Group-B', 'Group-C'};
fig = figure('Units','normalized', 'Position',[.1,.05,.5,.7]);
ax = axes('Parent',fig, 'Position',[.1,.1,.8,.8]);
% Draw group block (绘制分组方块)
SCB = SClusterBlock(ax, group, 'Orientation','top', 'Group',group);
SCB.draw();
SCB.setXYTLim('TLim', [pi/4, pi/4]);
% Draw rotated triangular heatmap (绘制旋转三角热图)
SHM = SHeatmap(ax, Data, 'Format','sq', 'VarName',labels, 'RowGroup',group, 'ColGroup',group);
SHM.draw();
SHM.setType('triu');
SHM.setText().showStars(pval, 'Levels', [0.05, 0.01, 0.001], 'CorrLabel','off')
SHM.setRowLabelLocation('right')
SHM.setXYTLim('TLim',[pi/4, pi/4]);
SHM.Colorbar.Location = 'southoutside';
set(SHM.colLabelHdl, 'Visible','off')
set(SHM.colTickHdl, 'Visible','off')
legend(SCB.blockHdl, gnames, 'FontSize',15, 'FontName','Times New Roman')