function ReScale_plot_ButtonDownCallback(src,eventdata)


Xdata = get(get(src,'Children'),'XData');
XLimits = get(src,'XLim');
idx = find ((Xdata{1} > XLimits(1)) & Xdata{1} < XLimits(2));

Ydata = get(get(src,'Children'),'YData');

YMin = NaN;
YMax = NaN;
for i = 1:length(Ydata)
    YMin = min([YMin Ydata{i}(idx)]);
    YMax = max([YMax Ydata{i}(idx)]);
end

if (isnan(YMin))
    YMin = 0;
end
if (isnan(YMax))
    YMax = YMin+1;
end

YMin = 1.05*YMin;
YMax = 1.05*YMax;
delta = YMax-YMin;
set(src,'YLim',[YMin YMax]);
set(src,'YTick',YMin:delta/8:YMax);
end

