clear;
clc;
f=figure;
a=axes('position',[.1 .25 .8 .65],'units','normalized');
ezplot(@sin);
xlim([-pi,pi]);
uicontrol('units','normalized','Style','slider','userdata',a,'pos',[.1 .1 .8 .05],'min',-pi,'max',pi,'callback',@(obj,event)set(get(obj,'userdata'),'xlim',[-pi,pi]+get(obj,'value')));
设置figure的position属性试试?