%**************************************************************************
%This function plots the absolute value of Bx and By vs Z field data.
%
%Input:
%plt_file, plot file for results
%param, structure containing the analysis parameters
%z, z position the field was measured at (m)
%bx, Bx measured field strength (T)
%by, By measured field strength (T)
%
%Zachary Wolf, 3/17/10

function [] = field_plot_abs_bxy(plt_file, param, z, bx, by)
    
%Plot the field
if param.fig_vis == false
    figure('visible', 'off');
else
    figure('visible', 'on');
end
hold on;
plot(z, abs(bx), '-r', 'linewidth', 1.5);
scale_fact = max(abs(bx)) / max(abs(by));
by_scaled = by * scale_fact;
plot(z, abs(by_scaled), '-b', 'linewidth', 0.3);
title('|Bx| and |By-scaled| vs Z');
xlabel('Z Position (m)');
ylabel('|Bx| (T), |By Scaled|');
util_add_pole_num_to_plot(param);  %Add pole numbers to the plot
grid on;
zoom on;
hold off;

%Write the figures to the plot file
util_print_fig(plt_file);

%Done
