function eigs=mode_traj(fname,iilog,iilab,sym,col,dotsize,psize,iivg,iinewfig)
% Call eigs=mode_traj('fname',iilog,iilab,sym,col,dotsize,psize,iivg,iinewfig);
% For Imag(k) linear scale, set iilog=0.  
% For log scale, set iilog=n, where 10^n will be the minimum on Imag(k) axis.
% Set iilab=1 to label modes and axes.
if nargin<2, iilog=0; end
if nargin<3, iilab=1; end
if nargin<4, sym='o'; end
if nargin<5, col='r'; end
if nargin<6, dotsize=10; end
if nargin<7, psize=[5,3.5]; end
if nargin<8, iivg=1; end
if nargin<9, iinewfig=1; end

eval(['load ',fname])
eval(['eigs=',fname,';'])
[nrow,ncol]=size(eigs);
ii=find(eigs(:,3)==0 | eigs(:,3)==1);
jj=find(eigs(:,3)==1);
iibp=find(eigs(:,3)==-5);
if iinewfig==1, figure; end
if iilog~=0,
	plot_cfill(eigs(ii,1),eigs(ii,2),sym,'k',dotsize/2,[],[],2);
	hold on;
	plot_cfill(eigs(jj,1),eigs(jj,2),sym,col,dotsize,[],[],2);
	plot_cfill(eigs(iibp,1),eigs(iibp,2),sym,'k',dotsize,[],[],2);
% Set lower limit on logarithmic y-axis:
	ax=axis; ax(3)=10^iilog; axis(ax);
else
%	H=plot(eigs(ii,1),eigs(ii,2),'r');
	plot_cfill(eigs(ii,1),eigs(ii,2),sym,'k',dotsize/2); 
	hold on;
	plot_cfill(eigs(jj,1),eigs(jj,2),sym,col,dotsize);
	plot_cfill(eigs(iibp,1),eigs(iibp,2),sym,'k',dotsize);
end
xlabel('Re(k)/K_w'); ylabel('Im(k) - dB/km'); 
mytitle(['Mode Trajectory in k Plane for ',fname]);
grid;
plot_size(gca,'in',psize(1),psize(2));
if iivg,
    plot_set3(gca,1,'Arial',14,1);
else
    plot_set3(gca,1,'Times',10,0);
end
if iilab==1,
	for j=1:length(jj)
		h=text(eigs(jj(j),1),eigs(jj(j),2),['  ',int2str(j)]);
        set(h,'FontName','Arial','FontSize',9);
	end
	h=text(eigs(iibp,1),eigs(iibp,2),'  BP');
    set(h,'FontName','Arial','FontSize',9);
end
zoom on;
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
