Prev: Annotation in figure disapperas
Next: biograph
From: us on 26 May 2010 11:24 "Michael " <michael.NO.salloker(a)fh-joanneum.SPAM.at> wrote in message <htjdkt$9d3$1(a)fred.mathworks.com>... > "us " <us(a)neurol.unizh.ch> wrote in message ... > > > one of the solutions > > > > t=0:1e-2:10; > > clear sh; % <- save old stuff(!)... > > sh(1)=subplot(2,1,1); > > line(t,sin(t)); > > sh(2)=subplot(2,1,2); > > line(t,cos(t)); > > annotation('arrow', [0.4, 0.2], [0.7, 0.7]); > > axis(sh(1)); > > line(t,sin(t)); > > > > us > > Thank you, but in your solution the last command draws a line in the lower subplot, not in the upper one. And I do not understand the statement > > axis(sh(1)); > > Michael yes... axis(sh(1)); % must read axes(sh(1)); % <- note the -E- % which forces the axis with handle SH(1) to be the current axis, ie, GCA... sorry for confusion... us
From: Michael on 26 May 2010 11:56 "us " <us(a)neurol.unizh.ch> wrote in message .... > yes... > > axis(sh(1)); > % must read > axes(sh(1)); % <- note the -E- > % which forces the axis with handle SH(1) to be the current axis, ie, GCA... > > sorry for confusion... > us Yes, that was what I thought as well, but with that correction your code does the same like mine original one. After the command axes the annotation disappears. Michael
From: us on 26 May 2010 12:25
"Michael " <michael.NO.salloker(a)fh-joanneum.SPAM.at> wrote in message <htjgal$8nr$1(a)fred.mathworks.com>... > "us " <us(a)neurol.unizh.ch> wrote in message > ... > > yes... > > > > axis(sh(1)); > > % must read > > axes(sh(1)); % <- note the -E- > > % which forces the axis with handle SH(1) to be the current axis, ie, GCA... > > > > sorry for confusion... > > us > > Yes, that was what I thought as well, but with that correction your code does the same like mine original one. After the command axes the annotation disappears. > > Michael one of the solutions - note: annotations use their own axis(!)... t=0:1e-2:10; clear sh; % <- save old stuff(!)... sh(1)=subplot(2,1,1); line(t,sin(t)); sh(2)=subplot(2,1,2); line(t,cos(t)); ah=annotation('arrow', [0.4, 0.2], [0.7, 0.7]); axes(sh(1)); line(t,cos(t)); set(ah,'parent',sh(1)); % <-... set(ah,'x',[4,2],'y',[.7,.7]); % <- must redo to fit arrow precisely into SH(1) us |