help-octave
[Top][All Lists]
Advanced

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

Flickering and drawnow plot


From: RT
Subject: Flickering and drawnow plot
Date: Fri, 13 May 2016 23:50:31 -0400

I'm trying to animate two 3d plots at the same time but I keep getting flickering does anyone now of a workaround or how to prevent the flickering?

See code below:  I'm using octave 4.0 on ubuntu 16.04 64bit

k1 = 1; %how many times you want wave to oscillate in x-dir
k2 = 1; %how many times you want wave to oscillate in y-dir
u = linspace(-pi,pi,30); %how many segments
v = linspace(-pi,pi,30); % how many segments
[x,y] = meshgrid(u,v);  %how many segments

w_len=max(length(x))

for ii=1:180
  z=sin(k2*x+(ii)*pi/180);
  z2=-sin(k2*y+(ii)*pi/180);
 
  surf(x,y,z);
  drawnow
  surf(x,y,z2);
  drawnow
 
  pause(.001)

end

reply via email to

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