%
%   loglin_plot_all_alt.m  ver 1.7  by Tom Irvine
%
function[fig_num]=loglin_plot_all_alt(fig_num,t_string,ppp,leg,xlab,ylab)
%

sz=size(ppp);

f=ppp(:,1);
amp=ppp(:,2:sz(2));

sz=size(amp);

%

hp=figure(fig_num);
%
hold on;


for i=1:sz(2)
    
    if(i<=2)
        try
            if(i==1)
                plot(f,amp(:,i),'b','DisplayName',char(leg(i)),'LineWidth',1);
            end
            if(i==2)
                plot(f,amp(:,i),'r','DisplayName',char(leg(i)),'LineWidth',1);
            end       
        catch
            if(i==1)
                plot(f,amp(:,i),'b','DisplayName',leg{i},'LineWidth',1);
            end
            if(i==2)
                plot(f,amp(:,i),'r','DisplayName',leg{i},'LineWidth',1);
            end
      
        end
        if(i==2)
            L = legend;
            legend show;
            L.AutoUpdate = 'off'; 
        end    
    else
        
        try
            plot(f,amp(:,i));
        catch
            try
                plot(f,amp(:,i));            
            catch
            end
        end
    end
end



set(gca,'MinorGridLineStyle',':','GridLineStyle',':','XScale','log','YScale','linear')
grid on;
  
title(t_string)
xlabel(xlab);
ylabel(ylab);

fmin=min(f);
fmax=max(f);


if(fmin>20)
    fmin=20;
end

%
[xtt,xTT,iflag]=xtick_label(fmin,fmax);

if(iflag==1)
    set(gca,'xtick',xtt);
    set(gca,'XTickLabel',xTT);
    fmin=min(xtt);
    fmax=max(xtt);
end

%
grid on;
set(gca, 'xminorgrid', 'on', 'yminorgrid', 'on')

xlim([fmin,fmax]);

fig_num=fig_num+1;

legend show;
    
legend('location','northeast')
set(hp, 'Position', [0 0 900 550]);
set(gca,'Fontsize',10.5);
    

hold off;

