function update_plot2

% Runs with Shim Thickness GUI.
% Created by Mark Smith
% 11/26/07

% Function reads GUI selection and Plots corresponding graph.

% Revised 2/28/08 to accomodate new shim labels.


% Check if data is available for plotting.
if evalin('base','thickness') == 0
    msgbox('Thickness Values Not Calculated');
    return
else % If the thickness are calculated perform the following.
    plot_list = get(findobj('tag','pm1'),'string');
    plot_selected = get(findobj('tag','pm1'),'Value');
    joint_type = evalin('base','joint_type');
    thickness  = evalin('base','thickness');
    switch plot_list{plot_selected}
        
        case 'Histogram'
            
            % Run shim_hist_plot.m function
            figure(3)
            shim_hist_plot;
            
        case 'Shims & Thickness 3D'
            
% Revision 2/28/08: filename changed. **************************** Revised            
            % Run plot_thickness3D_22808_r1.m function
            open('shim_thickness3D.fig');
            plot_thickness3D_22808_r1;

        case 'Shim Thickness 2D'
           fh1 = figure(3);
           bar(thickness(1:end-1));
           title_str = strcat(joint_type,' Joint: Shim Thicknesses Bar Chart');
           title(title_str,'fontsize',8)           
           xlabel('Shim Number','fontsize',8)
           ylabel('Thickness (inches)','fontsize',8)
        case 'Difference Adjacent Shims'
           fh1 = figure(3);
           plot(diff(thickness(1:end-1)));
           title('Difference Adjacent Shims','fontsize',8)           
           ylabel('(inches)','fontsize',8)
            
    end % Ends the SWITCH statement.
    
    
end % Ends the IF statement.
    