%**************************************************************************
%This function plots the second integral of By.
%
%Input:
%plt_file, plot file for results
%z, position along the undulator (m)
%i2y, second integral of By (Tm**2)
%input_name, legend for plot
%
%Zachary Wolf
%6/14/16

function [] = pid_comp_plot_i2y(plt_file, z, i2y, input_name)

%Make the plot
figure;
hold all;
[r, c] = size(z);
for ii = 1 : r
    x = z{ii, :};
    y = i2y{ii, :};
    plot(x, y, 'linewidth', .5);
end
title('I2Y vs Z');
xlabel('Z (m)');
ylabel('I2Y (Tm**2)');
legend(input_name', 'location', 'northwest');
grid on;
zoom on;
hold off;
util_print_fig(plt_file);

%Done
