%---------------------------------------
% CODE FROM PASCAL VOC2006 DEVELOP KIT
% (Modified)
%---------------------------------------
function h=getROCfig(fp,tp,linestyle,msg)

aa = fp;
bb = tp;
di=[true ; bb(2:end-1)~=bb(1:end-2) ; true];
x=aa(di);
y=bb(di);
xp=[0 ; reshape([x x]',[],1) ; 1 ; 1];
yp=[0 ; 0 ; reshape([y y]',[],1) ; 1];
h = plot(xp,yp,linestyle,'LineWidth',2);
grid;
axis([0 1 0 1]);
xlabel 'false positive rate'
ylabel 'true positive rate'
title(msg);
