figure;
t = plot(1:20, oa_sm_all(1:20),'k-^', 1:20, 0.01* ac_emp(1)*ones(20,1), 'r' ,1:20, 0.01*ac(1)*ones(20,1), 'b' ) ;
set(t, 'LineWidth', 2);
xlabel('\lambda', 'FontSize', 16)
ylabel('Overall Accuracy', 'FontSize', 16)
h_legend = legend('SVM+Graph Laplacian', 'EMP+SVM' , 'SVM');
set(h_legend,'FontSize',12);
axis([1 20 0.01*ac(1)-0.002 max(oa_sm_all) + 0.002 ] );
t = plot(1:20, oa_sm_all(1:20),'k-^', 1:20, 0.01* ac_emp(1)*ones(20,1), 'r' ,1:20, 0.01*ac(1)*ones(20,1), 'b' ) ;
set(t, 'LineWidth', 2);
xlabel('\lambda', 'FontSize', 16)
ylabel('Overall Accuracy', 'FontSize', 16)
h_legend = legend('SVM+Graph Laplacian', 'EMP+SVM' , 'SVM');
set(h_legend,'FontSize',12);
axis([1 20 0.01*ac(1)-0.002 max(oa_sm_all) + 0.002 ] );
set(gca,'FontSize',12);
section 2:
在迭代中,显示某些量随迭代次数的变化情况。
figure;
for i=1:n
...
plot(x,'r.'), drawnow
end
%%%% 保持成清晰些的pdf格式图像
h = figure;
color = {'r.', 'g*', 'b^', 'ms', 'k>' } ;
for i= 1:5
ind = ( label == i ) ;
im = ydata( ind, : ) ;
plot( im(:,1), im(:,2), color{i} ) ;
hold on ;
end
h_legend = legend('0', '1' , '2', '3', '4' );
print(h,'-dpdf','Figure2.pdf') % 这里存成 名为 Figure2.pdf 的 文件,
%%%% saveas
legend( 'Location', 'best' ) ;
saveas(gca, '.mypic.pdf', 'pdf') ;