% Make the plots for the Ion Pump 2 Stray Field Study
%
%
%
function quiverplot2(A1,Ab,fignumber, figtitle)
[n,p]=size(Ab);
t=1:n;
d=Ab(t,1);
Bxb=Ab(t,2)/10.; % background -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.; % data -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;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dz=(100:-2:0)';   % A  51x1 column for -2 step

yyy=dz;          % Our z-direction, plot's y
xxx=ones(51,1);  % Our x-direction, plot's x (towards viewer)
zzz=ones(51,1);  % Our -y-direction plot's z (up)
vvv=Bzpd;   % Our z to the right = yyy-direction
uuu=Bxpd;   %0.001*ones(51,1); %Bxpd;   % Our x is towards us/away from pump = xxx-direction
www=-Bypd;  %0.000001*ones(51,1); %-Bypd;  % Our y is down  = -zzz direction
scale=0.25;
%
figure(fignumber)
quiver3(xxx,yyy,zzz,uuu,vvv,www,scale)
view([70 18])

%plot(dz,vvv,'-+r')
%xlabel('d [cm]');ylabel('|B-backgd| [Gauss]')
%hold on
%grid on
%subplot(2,1,2)
%plot(d,Btb,'-+b')
%plot(d,Btp,'-+g')
title(figtitle)
legend('B-backgd')
% All done



