help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Antwort: Re: refreshdata produces unexpected results


From: claus . kricke
Subject: Antwort: Re: refreshdata produces unexpected results
Date: Tue, 23 Mar 2010 13:28:27 +0100


Hi David,

thanks for the background.
However, would checking "__modified__" help if
get (allchild(gca()),"__modified__") always delivers "on" ???
What methods do control the "__modified__" flag ?

Is it worth pursuing a solution based on gnuplot
or is there some other backend just around the corner, who will do the job ?

regards
  Claus



Von: David Bateman <address@hidden>
An: address@hidden
Kopie: address@hidden
Datum: 22.03.2010 20:37
Betreff: Re: refreshdata produces unexpected results





address@hidden wrote:
> Hi,
>
> the refreshdata command, intended to update plot data selectively, doesn't
> work as I'd expect.
> It seems all graphics data is redrawn, not only changed data.
> Consider the following example:
>
> x = 0:0.1:10;
> y1 = sin (x);
> y2 = cos (x);
> subplot ( 1, 2, 1) ;
> plot (x, y1, "ydatasource", "y1");
> subplot ( 1, 2, 2) ;
> plot (x, y2, "color",[1, 0, 0], "ydatasource", "y2");
> for i = 1 : 30
>    y1 = sin (x + 0.1 * i);
>    y2 = cos (x + 0.1 * i);
>    refreshdata(gcf(), "caller");
>    pause(0.01);
>  endfor
>
> The plot window is redrawn completely with every call to refreshdata.
> The result is a very jerky, jolty diagram instead of a smooth animation.
>  
> The following example tries to do the same thing, avoiding the overhead of
> the
> refreshdata command. However, the result is only a moderate speed-up
> leaving you
> with basically the same situation
>
> x = 0:0.1:10;
> y1 = sin (x);
> y2 = cos (x);
> subplot ( 1, 2, 1) ;
> plt1 = plot (x, y1 );
> subplot ( 1, 2, 2) ;
> plt2 = plot (x, y2, "color",[1, 0, 0]);
> for i = 1 : 30
>    y1 = sin (x + 0.1 * i);
>    y2 = cos (x + 0.1 * i);
>    set ( plt1, "ydata", y1 );
>    set ( plt2, "ydata", y2 );
>    pause(0.01)
> endfor
>
> This behaviour is the same on ;-) and on linux.
>
> Anything  I got wrong or misunderstood ?
> Could the gnuplot config file be in error or in need for modifications ?
>
> Any idea, how a smooth animation could be achieved ?
>
> adTHANKSvance,
>    Claus
>
>  
From the way the gnuplot interface is implemented, refreshdata has to
redraw an entire figure each time as gnuplot had no way to do a "replot"
from a stream. In fact it seems that the __go_draw_figure__ function
doesn't check the __modified__ property of the figure and so all figures
are redrawn even though probably only figures that are modified should
be redrawn

D.



+----------------------------------------------------------------------+
| ETAS Mail Security -
http://intranet.etasgroup.com/encryption        |
+----------------------------------------------------------------------+
| - The message was not encrypted and not digitally signed             |
+----------------------------------------------------------------------+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]