orange has asked for the wisdom of the Perl Monks concerning the following question:
use warnings; use strict; use Tk; my $mw = MainWindow->new; my $x = 0; my $y = 0; my $pi = 3.1415926; my $counter=0; my $c = $mw->Canvas(-width => 500, -height => 500); $c ->pack; # draw axis $c -> createLine(50, 250, 450, 250); $c -> createText(10, 250, -fill => 'blue', -text => 'X'); $c -> createLine(250, 50, 250, 450); $c -> createText(250, 10, -fill => 'blue', -text => 'Y'); for ( $x = -(3*$pi); $x <= +(3*$pi); $x += 0.05) { $y = sin($x); $c -> createText( $x*30+250, $y*30+250, -fill => 'red', -text => '.'); $counter=0; # delay loop while ($counter <= 100000) { $counter++; } $mw->update; } MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: plotting slowly
by graff (Chancellor) on Apr 23, 2007 at 17:06 UTC | |
|
Re: plotting slowly
by kyle (Abbot) on Apr 23, 2007 at 16:57 UTC | |
|
Re: plotting slowly
by Fletch (Bishop) on Apr 23, 2007 at 17:01 UTC | |
|
Re: plotting slowly
by zentara (Cardinal) on Apr 23, 2007 at 20:06 UTC |