Info

This question is closed. Reopen it to edit or answer.

Unable to find correct legend in order

2 views (last 30 days)
Mukesh Singh
Mukesh Singh on 1 Aug 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
B = load('pNEWS20.txt'); A = load('NEWS20.txt');
figure
[ax, h1, h2] = plotyy(A(1:300,1),A(1:300,2),A(1:300,1),A(1:300,4));
set(h1,'LineStyle','--' , 'LineWidth',3)
set(h2,'LineStyle','--','LineWidth',1)
set(ax(1),'YLim',[500 5000],'ytick',[500 1000 1500 2000 2500 3000 3500 4000 4500 5000]);
set(ax(2),'YLim',[50 100],'ytick',[50 60 70 80 90 100]);
set(ax,'NextPlot','add')
h3 = plot(ax(1),1:300,1026.4428,'-.','LineWidth',1);
h4 = plot(ax(2),1:300,93.37,':','LineWidth',1);
h5 = plot(ax(1),B(1:300,1),B(1:300,2),'-.r','LineWidth',3);
h6 = plot(ax(2),B(1:300,1),B(1:300,3),'g-','LineWidth',3);
legend([h1;h2;h3;h4;h5;h6],'FunVal By DCD' , 'Acc By DCD','FunVal By LibSvm' , 'Acc By LibSvm','FunVal By Pegasos' , 'Acc By Pegasos');
title('NEWS20 Dataset ')
xlabel('Iteration Number')
ylabel(ax(2),'Accuracy') % left y-axis
ylabel(ax(1),'Function Value') % right y-axis

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!