|
From: Erik on 18 Jun 2008 20:34 Hi, I have multiple graphics on one plot, one of which is clickable. Now when I plot something new, say some sort of 'area' plot, it hides my line from the mouse. Is there any way to change the depth of a plot (i.e. plot a line behind preexisting lines, instead of on top) Thanks, Erik
From: us on 18 Jun 2008 21:06 "Erik ": <SNIP wants to stack his/her lines... two of the solutions (copy/paste into command window) n=2; nd=10; x=1:nd; cmap=jet(2); lh=zeros(n,1); % use zdat prop subplot(2,1,1); for i=1:n lh(i,1)=line(x,rand(1,nd),repmat(-i,1,nd),... 'linewidth',5*i,... 'color',cmap(i,:)); end shg; % - toggle lines for i=1:nd z=sign(rem(i,2)-.5)*-100; set(lh(1),'zdata',repmat(z,1,nd)); pause(.5); end % use handle stacking % - note: zdata must be equal subplot(2,1,2); for i=1:n lh(i,1)=line(x,rand(1,nd),... 'linewidth',5*i,... 'color',cmap(i,:)); end % - toggle lines for i=1:5 uistack(lh([1,2]),'top'); pause(.5); uistack(lh([2,1]),'top'); pause(.5); end typically, you'd implement either solution in a callback... us
|
Pages: 1 Prev: Normalizing RGB image Next: Display images froma folder in MATLAB GUI |