octave-maintainers
[Top][All Lists]
Advanced

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

Re: more graphics changes.


From: Søren Hauberg
Subject: Re: more graphics changes.
Date: Mon, 19 Mar 2007 21:19:00 +0100
User-agent: Thunderbird 1.5.0.10 (X11/20070307)

Daniel J Sebald skrev:
Søren Hauberg wrote:
John W. Eaton skrev:

It would be helpful to me if people who have been using the new
graphics features could check that I haven't broken too many things.
Please report any problems that you find to this list.

Currently it's hard to do complex animations because they "flicker" a lot. To see what I'm talking about you can run the following code:

N = 500;
iterations = 30;
x = linspace(0, 20*pi, N);
y = sin(x);

figure(1)
for i = 1:iterations
  clf
  hold on
  for j = 1:N-1
    h = plot(x(j:j+1), y(j:j+1), 'o');
    set(h, "color", rand(1,3));
  endfor
  hold off
  drawnow # Needed until pause calls drawnow
  pause(0.5)
endfor

The problem seems to be that "clf" calls "drawnow" which means that each iterations in the above code calls "drawnow" twice which causes the "flickering" (is that even a word). Things seem to work for me if I remove the call to "drawnow" in "clf" but since I don't know the internals of the system I don't know if that'll break anything.

Yes, flickering is a word ("And moth-like stars were flickering out" -- Yeats)...
Thanks, not only for the English lesson but also for the culture :-)

For me, redraws take 11 seconds. (I have a five year old system, but still can't figure out why graphics is so slow.)
In complex plots there is a problem on the octave side. If I remove the call to drawnow in clf I get smooth but slow animations, so I guess gnuplot is fast enough.

There is the possibility of doing GIF animations, but that's not portable of course.
Yeah, that's what I currently do for complex animations. For more simple animations (which is what I most often need) the current system is good enough (once I remove the call to drawnow in clf, that is).

Søren



reply via email to

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