%
%  plot_peak_histogram.m  ver 1.0  December 3, 2012
%
function[fig_num]=plot_peak_histogram(y,amp_label,fig_num)
%
while(1)
            clear x;
            nbar=input(' Enter the number of bars ');
            xx=max(abs(y));
            x=linspace(0,xx,nbar);       
            figure(fig_num);
            fig_num=fig_num+1;
            hist(y,x)
            ylabel(' Counts');
            xlabel('Amplitude');  
            title(amp_label); 
            disp(' Re-plot with different number of bars? ');
            disp(' 1=yes  2=no ');
            irp=input(' ');
            if(irp==2)
                break;
            end
end
