from One-time rescale subplots by Benny Veikhman
one time rescales all subplots of figure by x range

fig_resize (first_point, last_point)
%
%	Last modification 22, May, 2006
%
function result  = fig_resize (first_point, last_point)


cf = gcf;
my = get (cf);
my.Childrenstart_xlim = get(my.Children(end),'xlim');

result =0;

for ind=1:1:length(my.Children)
     try,
        set(my.Children(ind),'XLimMode', 'auto');
        set(my.Children(ind),'Xlim', [first_point last_point]);
        set(my.Children(ind),'YLimMode', 'auto');
     	result = result +1;
     end;
end;

figure(cf);
drawnow;
beep;
return;

Contact us at files@mathworks.com