function [varargout]= plotInv(IDS,varargin)
%Input argument is Inv Data Structure from slurpInv
% 08/27/2007
%  Karl Kappler
INV=IDS;
mu0=pi*4e-7;
xunits='us'; 
saveplot=0;
polarities='xyz';
%Housekeeping%
clf;fclose('all');
figure(4); 
loglog(INV.t,abs([INV.p1; INV.p2; INV.p3]));%,'linewidth',2);
a=gca;h=get(a,'children');
%set(h(3),'linewidth',1); %default linewidth is 0.5
ylim([0.001,12]);
xlim([1e-4,.002]);
ylabel(['Principal Polarizabilities [m^{3}/s] '],'fontsize',15)
xlabel(['Time [s] '], 'fontsize',15)
ttl=strrep(INV.fname,'_',' ');
if isfield(IDS,'GT')
    ttl=[ttl,': ',IDS.GT];
end
title(ttl,'fontsize',15)
text(2e-4,1,['Position <',num2str(INV.posn'),'> m']);
text(2e-4,0.8,['Theta <' num2str(INV.thetaV') '>']);
text(2e-4,0.65,['Phi <' num2str(INV.phiV') '>']);
text(2e-4,0.5,['avgPolarindex: ',num2str(INV.avgPolarindex),'cm^3']); 
%changed to m^3 from cm^3 on 11Dec2007
%and back to cm^3 on 13 Dec


if saveplot
     if nargin>1
            svfname=[DataDir,file1,'-',file2];
     else 
            svfname=[DataDir,file1];
     end;
    cmd=['print -djpeg ',svfname,'.jpg',]
    eval(cmd);
end;
