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 20:55:14 +0100
User-agent: Thunderbird 1.5.0.10 (X11/20070307)

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.

Søren


reply via email to

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