|
From: Rafael L. <rla...@us...> - 2005-03-18 16:13:44
|
I am forwarding below a post made in the PDL mailing list. I translated
the Perl script to C (program attached below) and the (mis)behavior is
the same. Could someone help this user?
--
Rafael
----- Forwarded message from Andreas Letsch <le...@if...> -----
From: Andreas Letsch <le...@if...>
Subject: PerlDL: animation with plplot within a sub window
Date: Fri, 18 Mar 2005 14:18:16 +0100
To: pdl-liste <pe...@ja...>
Hi list,
maybe this is more a plplot-question than a PDL-question, but since
plplot should take over from pgplot, I hope that you can help me with
this:
I want to do a animation and everything looks nice if I use only one
main window.
Now, I tried to use subpage since I want to look at two functions with
strong varying values, each function is plotted to its own subpage. Now
only the last subpage is updated.
To study this I wrote the following code which should plot a sin to the
first subpage and cos to the second subpage, the for-loop changes the
phase of both, but only the second subpage is updated.
---------------------------------------------------------------
use PDL;
use PDL::Graphics::PLplot;
use Math::Trig qw [pi];
use Time::HiRes qw [usleep];
plsdev("tk");
plinit();
plsetopt("geometry","1000x500");
plssub(1,2);
plenv(0,10,-1.2,1.2,0,0);
# create xvalues from 0 to 10
my $x=sequence(100)/10;
plenv(0,10,-1.2,1.2,0,0);
plxormod(1);
for(my $i=0;$i<10;$i++){
pladv(1);
plline($x,sin($x+$i/10));
pladv(2);
plline($x,cos($x+$i/10));
usleep (500000);
plflush ();
pladv(1);
plline($x,sin($x+$i/10));
pladv(2);
plline($x,cos($x+$i/10));
}
plend();
----------------------------------------------------------------
What is wrong?
Thanks for any suggestions,
Andreas
----- End forwarded message -----
|