%**************************************************************************
%This function plots the phase errors as a function of pole number.
%
%Input:
%plt_file, plot file for results
%param, structure containing the analysis parameters
%pole_num_no_ends, pole number, no ends
%phase_error_peak_no_ends, phase error at the field peaks, no ends (rad)
%
%Zachary Wolf, 3/27/06

function [] = phaserr_shim_plot_phaserr(plt_file, param, pole_num_no_ends, phase_error_peak_no_ends)

%Conversion factor from radians to degrees
cf = 360 / (2 * pi);

%Plot the phase errors
if param.fig_vis == false
    figure('visible', 'off');
else
    figure('visible', 'on');
end
hold on;
plot(pole_num_no_ends, phase_error_peak_no_ends * cf, '-b', 'linewidth', 2.0);
xlim([0, pole_num_no_ends(end) + pole_num_no_ends(1) - 1]);
title('Phase Error At Poles, No Ends');
xlabel('Pole Number');
ylabel('Phase Error (deg)');
grid on;
zoom on;
hold off;

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

%Done
