Last change
on this file since 140 was
20,
checked in by bduin, 13 years ago
|
updates for handling soft labels
|
File size:
1.0 KB
|
Line | |
---|
1 | %PLOTSPECTRUM
|
---|
2 | %
|
---|
3 | % h = PLOTSPECTRUM(L)
|
---|
4 | % h = PLOTSPECTRUM(W)
|
---|
5 | %
|
---|
6 | % Plot spectrum as stored in vector L or in mapping W.
|
---|
7 |
|
---|
8 | function [h1,h2] = plotspectrum(L)
|
---|
9 |
|
---|
10 | if ismapping(L)
|
---|
11 | if strcmp(getmapping_file(L),'psem')
|
---|
12 | L = getdata(L,4);
|
---|
13 | tit = 'Embedding Spectrum';
|
---|
14 | elseif strcmp(getmapping_file(L),'affine') | strcmp(getmapping_file(L),'pe_em')
|
---|
15 | try
|
---|
16 | L = getdata(L,'eval');
|
---|
17 | tit = 'Eigenvalues';
|
---|
18 | catch
|
---|
19 | error('No spectrum found');
|
---|
20 | end
|
---|
21 | else
|
---|
22 | error('No spectrum found')
|
---|
23 | end
|
---|
24 | else
|
---|
25 | tit = 'Eigenspectrum';
|
---|
26 | end
|
---|
27 |
|
---|
28 | L = flipud(sort(L(:)));
|
---|
29 | sig1 = max(find(L>=0));
|
---|
30 | sig2 = length(L) - sig1;
|
---|
31 |
|
---|
32 | if sig2 == 0
|
---|
33 | hh1 = plot([1:sig1],[L(1:sig1)]);
|
---|
34 | else
|
---|
35 | hh1 = plot([1:sig1 sig1+0.5],[L(1:sig1);0]);
|
---|
36 | hold on;
|
---|
37 | hh2 = plot([sig1+0.5 sig1+1:sig1+sig2],[0;L(sig1+1:end)],'r');
|
---|
38 | hold off
|
---|
39 | end
|
---|
40 | V = axis;
|
---|
41 | V(1) = -1;
|
---|
42 | V(2) = length(L)+2;
|
---|
43 | axis(V);
|
---|
44 | fontsize(16);
|
---|
45 | linewidth(2);
|
---|
46 | xlabel('Eigenvector')
|
---|
47 | ylabel('Eigenvalue')
|
---|
48 | title(tit)
|
---|
49 | if nargout > 1
|
---|
50 | h1 = hh1;
|
---|
51 | h2 = hh2;
|
---|
52 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.