?? plotembedding.m
字號:
function PlotEmbedding (hObject, eventdata, handles, plotNumber)
% --- Plot the output embedding.
[m,n] = size(handles.Y);
if get(handles.ColorCheck,'Value') == 1 & handles.isExample == 0
handles.ColorVector = evalin ('base',get(handles.ColorEdit,'String'));
Clength = length(handles.ColorVector);
if Clength < m
handles.ColorVector(Clength+1:m) = handles.ColorVector(Clength);
elseif Clength > m
handles.ColorVector = handles.ColorVector(1:m);
end;
end;
guidata(hObject, handles);
if plotNumber == 0
axes(handles.embedAXES);
else
subplot(3,3,plotNumber+1);
end;
if n == 2
if get(handles.ColorCheck,'Value') == 1 | handles.isExample == 1
scatter(handles.Y(:,1),handles.Y(:,2),12,handles.ColorVector,'filled');
else
scatter(handles.Y(:,1),handles.Y(:,2),12,'filled');
end;
axis tight;
elseif n == 3
if get(handles.ColorCheck,'Value') == 1 | handles.isExample == 1
scatter3(handles.Y(:,1),handles.Y(:,2),handles.Y(:,3),12,handles.ColorVector,'filled');
else
scatter3(handles.Y(:,1),handles.Y(:,2),handles.Y(:,3),12,'filled');
end;
axis tight;
elseif n == 1
if get(handles.ColorCheck,'Value') == 1 | handles.isExample == 1
scatter(handles.Y(:,1),ones(m,1),12,handles.ColorVector,'filled');
else
scatter(handles.Y(:,1),ones(m,1),12,'filled');
end;
axis tight;
else
cla;
axis([-1 1 -1 1]);
text(-0.7,0,'Only plots 2D or 3D data');
axis off;
end;
timeunits = 's';
if handles.runTime >= 60
handles.runTime = handles.runTime / 60;
timeunits = 'm';
end;
if handles.runTime >= 60
handles.runTime = handles.runTime / 60;
timeunits = 'h';
end;
switch plotNumber
case 1
title(['MDS: ',num2str(handles.runTime),timeunits]);
pause(0.01);
case 2
title(['PCA: ',num2str(handles.runTime),timeunits]);
pause(0.01);
case 3
title(['ISOMAP: ',num2str(handles.runTime),timeunits]);
pause(0.01);
case 4
title(['LLE: ',num2str(handles.runTime),timeunits]);
pause(0.01);
case 5
title(['Hessian LLE: ',num2str(handles.runTime),timeunits]);
pause(0.01);
case 6
title(['Laplacian: ',num2str(handles.runTime),timeunits]);
xlabel(['KNN = ',num2str(handles.K)]);
pause(0.01);
case 7
title(['Diffusion Map: ',num2str(handles.runTime),timeunits]);
xlabel(['Alpha = ',num2str(handles.alpha)]);
pause(0.01);
case 8
title(['LTSA: ',num2str(handles.runTime),timeunits]);
xlabel(['Sigma = ',num2str(handles.sigma)]);
end;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -