% Make the plots for the Ion Pump 2 Stray Field Study
%
%
%
function plot1diff(A1,Ab,fignumber, figtitle1)
[n,p]=size(Ab);
t=1:n;
d=Ab(t,1);
Bxb=Ab(t,2)/10.; % Now in Gauss or 0.1mT
Byb=Ab(t,3)/10.;
Bzb=Ab(t,4)/10.;
% [n,p]=size(A1); should be the same
d=A1(t,1);
Bxp=A1(t,2)/10.; % Now in Gauss or 0.1mT
Byp=A1(t,3)/10.;
Bzp=A1(t,4)/10.;
Bxpd=Bxp-Bxb; % Subtract background field
Bypd=Byp-Byb;
Bzpd=Bzp-Bzb;
figure(fignumber)
%
subplot(2,1,1)
plot(d,Bxpd,'-+b')
title(figtitle1)
xlabel('d [cm]');
ylabel('Bx, By [Gauss]')
hold on
plot(d,Bypd,'-+g')
axis([0.,100.,-1.,1.])
legend('Bx','By')
grid on
%
subplot(2,1,2)
plot(d,Bzpd,'-+r')
axis([0.,100.,-0.25,0.15])
legend('Bz')
grid on
title(figtitle1)
xlabel('d [cm]');
ylabel('Bz [Gauss]')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% All done



