function  stop  = plotfunc( options,optimvalues,flag )
%PLOTFUNC Summary of this function goes here
%   Detailed explanation goes here
global g_im
global file_name
stop = false;
% Calculate fraction of 'doneness' for each criterion
s = optimvalues.x ;
im=(file_name);
im=im(1:end-50,:,:);
% Multiply ratios by 100 to get percentages
hz=77;
xx=hz:240;



switch flag
    case 'init'
       imshow(g_im,[])
        
    case 'iter'
        ER = s(1)./ (xx - hz) + s(2) .* (xx - hz) + s(3);
        EL = s(1)./ (xx - hz) + s(4) .* (xx - hz) + s(3);
        imshow(g_im,[]),hold on
        plot(ER,xx,'r')
        plot(EL,xx,'g')
        hold off
%         text(10,10,num2str(s(1)),'Color','r','BackgroundColor','W')
%         text(10,20,num2str(s(2)),'Color','r','BackgroundColor','W')
%         text(10,30,num2str(s(3)),'Color','r','BackgroundColor','W')
%         text(10,40,num2str(s(4)),'Color','r','BackgroundColor','W')

end

