From: workaholic on 17 Jan 2010 01:03 I want to show a batch of data in an animation in plot,combining with 'drawnow' and 'refreshdata' command. But I found that the axis is constantly changing accordingly. How can I fix the axis?
From: Jan Simon on 17 Jan 2010 06:53 Dear workaholic! > I want to show a batch of data in an animation in plot,combining with > 'drawnow' and 'refreshdata' command. But I found that the axis is > constantly changing accordingly. How can I fix the axis? I cannot understand the question. What part/kind/entity of the axis is changing accordingly to what? Do you look for the AXES objects property 'NextPlot' and set it to 'add'? I suggest, you post the small part of your program, which reproduces the problem. Kind regards, Jan
From: Bruno Luong on 17 Jan 2010 07:16 workaholic <liuauto(a)gmail.com> wrote in message <288f2be6-c093-482a-a36a-9708edcff329(a)a6g2000yqm.googlegroups.com>... > I want to show a batch of data in an animation in plot,combining with > 'drawnow' and 'refreshdata' command. But I found that the axis is > constantly changing accordingly. How can I fix the axis? Use AXIS command to force the axis at given fixed limits. Bruno
From: workaholic on 18 Jan 2010 08:10 On 17 Jan., 11:53, "Jan Simon" <matlab.THIS_Y...(a)nMINUSsimon.de> wrote: > Dear workaholic! > > > I want to show a batch of data in an animation in plot,combining with > > 'drawnow' and 'refreshdata' command. But I found that the axis is > > constantly changing accordingly. How can I fix the axis? > > I cannot understand the question. What part/kind/entity of the axis is changing accordingly to what? > Do you look for the AXES objects property 'NextPlot' and set it to 'add'? > > I suggest, you post the small part of your program, which reproduces the problem. > > Kind regards, Ja My code is below: h = plot(xpos,ypos,'XDataSource','xpos','YDataSource','ypos'); for k = 1:tlen % pos is a data pool xpos = pos(k,:); ypos = pos(k+1,:); refreshdata(h,'caller') % Evaluate y in the function workspace drawnow; pause(.1) end I tried to put some code before the plot command like axis([xmin xmax ymin ymax]) but it does not work at all, the coordinate of the plot is changing at every iteration. How can I deal with it? Thanks
From: Jos (10584) on 18 Jan 2010 08:49 workaholic <liuauto(a)gmail.com> wrote in message <bbb5b046-b3ca-4044-940a-42ff66c0a145(a)f12g2000yqn.googlegroups.com>... > On 17 Jan., 11:53, "Jan Simon" <matlab.THIS_Y...(a)nMINUSsimon.de> > wrote: > > Dear workaholic! > > > > > I want to show a batch of data in an animation in plot,combining with > > > 'drawnow' and 'refreshdata' command. But I found that the axis is > > > constantly changing accordingly. How can I fix the axis? > > > > I cannot understand the question. What part/kind/entity of the axis is changing accordingly to what? > > Do you look for the AXES objects property 'NextPlot' and set it to 'add'? > > > > I suggest, you post the small part of your program, which reproduces the problem. > > > > Kind regards, Ja > > > My code is below: > > h = plot(xpos,ypos,'XDataSource','xpos','YDataSource','ypos'); > > for k = 1:tlen > > % pos is a data pool > > xpos = pos(k,:); > ypos = pos(k+1,:); > > refreshdata(h,'caller') % Evaluate y in the function workspace > drawnow; pause(.1) > end > > I tried to put some code before the plot command like axis([xmin xmax > ymin ymax]) but it does not work at all, the coordinate of the plot is > changing at every iteration. How can I deal with it? > Thanks Here is an alternative, using SET instead of refreshdata, so not all sources are refreshed on each loop: % data (Lissajous curves) t = linspace(0,2*pi,50) ; x = 2 * sin(3*t) ; y = 3 * sin(4*t) ; figure % force view h = plot(x(1),y(1),'b-',x(1),y(1),'ro') ; pause(0.5) ; axis([-3 3 -4 14]) ; % specify a strange axis, that is not changed for ii=2:numel(x), % update plots set(h(1),'xdata',x(1:ii),'ydata',y(1:ii)) ; set(h(2),'xdata',x(ii),'ydata',y(ii)) ; pause(0.1) ; drawnow ; % visibility end hth Jos
|
Next
|
Last
Pages: 1 2 Prev: Before this Thursday !!! about easy shortest path Next: cpselect in GUI |