%**************************************************************************
%This function plots the requested and actual field integral changes from
%the shims used to adjust the x trajectory.
%
%Input:
%plt_file, plot file for results
%anal_name, name of the analysis
%z, position along the undulator (m)
%Iy_bef, integral of By before shim (Tm)
%Iy_aft, integral of By after shim (Tm)
%Iy_shim, integral of the shim fields (Tm)
%
%Zachary Wolf, 4/22/07

function [] = shim_effect_plot_xtraj(plt_file, anal_name, z, Iy_bef, Iy_aft, Iy_shim)

%Plot the field integrals
figure;
hold on;
plot(z, Iy_aft - Iy_bef, 'b-', 'linewidth', 1.);
plot(z, Iy_shim, 'r-', 'linewidth', 1.);
title(anal_name);
xlabel('Z Position (m)');
ylabel('Int By dz (Tm)');
legend('After - Before', 'Desired From Shims', 'location', 'northwest');
grid on;
zoom on;
hold off;
util_print_fig(plt_file);

%Done
