octave-maintainers
[Top][All Lists]
Advanced

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

Re: more graphics changes.


From: Daniel J Sebald
Subject: Re: more graphics changes.
Date: Mon, 19 Mar 2007 15:11:49 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

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)...

For me, redraws take 11 seconds. (I have a five year old system, but still can't figure out why graphics is so slow.)

There is the possibility of doing GIF animations, but that's not portable of 
course.

Dan




reply via email to

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