%
%  Name:   scaley
%
%  Usage:  scaley
%
%  Purpose:  Rescales the y axis
%

%  Version SWD960923
%
%  Author(s): Scott W. Doebling, doebling@lanl.gov
%
%  Institution: Los Alamos National Laboratory,
%               ESA-EA
%
%  Copyright (c) 1996, The Regents of the University
%       of California. (See top level of code for
%       full copyright statement.)
%

yminm = realmax;
ymaxm = realmin;

i1 = floor(fminm/df) + 1;
i2 = floor(fmaxm/df) + 1;

for i = 1:size(hline,1),
	fullY = get(hline(i,1),'Ydata');
    if length(fullY)>=i2
	yminm = min(yminm,0.9*min(fullY(i1:i2)));
	ymaxm = max(ymaxm,1.1*max(fullY(i1:i2)));
    end
end

set(haxes,'ylim',[yminm ymaxm])

set(hplttl(7),'string',sprintf('%3.2e',yminm))
set(hplttl(9),'string',sprintf('%3.2e',ymaxm))
