This repository has been archived by the owner on May 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
bannerplot.m
executable file
·64 lines (60 loc) · 2.22 KB
/
bannerplot.m
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
function bannerplot(usedvars,separationstep,nobs,class,heights,objectorder)
%BANNERPLOT creates a banner for the output of the clustering algorithms
%agnes, diana or mona.
%
% I/O: bannerplot(out)
%
% This function is part of LIBRA: the Matlab Library for Robust Analysis,
% available at:
% http://wis.kuleuven.be/stat/robust.html
%
%Note: execute the following command if you have run the bannerplot at the
%commandline to ensure the axes are reset to their original colours for the
%next plot on the same figure window
% > whitebg([1 1 1])
%
% Last update: 12/02/2009 by S.Verboven
switch class
case 'MONA'
Y=separationstep;
stepmax=max(Y)+1;
Y(Y==0)=stepmax;
barh(fliplr(Y),1)
set(gcf, 'Name','Banner','numbertitle','off')
whitebg([1 1 1])
xlabel('Separation Step')
xticks=0:stepmax;
set(gca,'XTick',xticks,'XTickLabel',xticks,'xcolor','k');
axis([0,stepmax,0.5,nobs-0.5])
Uvar=num2str(usedvars);
Uvar=fliplr(Uvar);
for k=1:nobs-1
Uvar2(k)=Uvar(k+((k-1)*2));
end
for i=1:(usedvars-1)
if Y(i)<stepmax
text(Y(i)+0.3,i,Uvar2(i))
end
end
case 'AGNES'
bprops=barh(fliplr(heights),1,'w','edgecolor','w');
fig = ancestor(bprops,'figure');
set(fig, 'Name','Banner','numbertitle','off')
set(gca(fig),'color',[0.4 0.5 0.75])
xlabel('Height','color','k')
set(gca,'YAxisLocation','right','xcolor','k')
axis([min([heights 0]), max([heights 0]), 0.45, nobs-0.45])
case 'DIANA'
bprops=barh(fliplr(heights),1,'w','edgecolor','w');
fig = ancestor(bprops,'figure');
set(fig, 'Name','Banner','numbertitle','off')
set(gca(fig),'color',[0.4 0.5 0.75])
xlabel('Height','color','k')
set(gca,'XDir','reverse','xcolor','k');
axis([min([heights 0]), max([heights 0]), 0.45, nobs-0.45])
end
set(gca,'XColor','k','YColor','k')
yticks=0.5:nobs;
set(gca,'YTick',yticks,'YTickLabel',fliplr(objectorder),'ycolor','k');
title(['Banner obtained with ', class,' clustering'],'color','k')
ylabel('Objects','color','k')