| 1 |
#!/usr/bin/perl |
| 2 |
use Graphics::Libplot ':ALL'; |
| 3 |
|
| 4 |
# type of plotting device |
| 5 |
$device = 'X'; |
| 6 |
if (@ARGV) { |
| 7 |
$device = $ARGV[0]; |
| 8 |
# die "Uknown device: $ARGV[0]" unless $ARGV[0] =~ /^ps|X|fig$/; |
| 9 |
} |
| 10 |
|
| 11 |
$handle = $angle = 0; |
| 12 |
# /* set Plotter parameters */ |
| 13 |
pl_parampl ("BITMAPSIZE", "300x300"); |
| 14 |
pl_parampl ("BG_COLOR", "blue"); # /* background color for window */ |
| 15 |
pl_parampl ("USE_DOUBLE_BUFFERING", "yes"); |
| 16 |
|
| 17 |
$handle = pl_newpl ($device, stdin, stdout, stderr); |
| 18 |
pl_selectpl ($handle); |
| 19 |
|
| 20 |
pl_openpl (); |
| 21 |
pl_fspace (0.0, 0.0, 1.0, 1.0); # /* use normalized coordinates */ |
| 22 |
pl_pencolorname ("white"); |
| 23 |
pl_ffontsize (0.2); |
| 24 |
pl_fontname ("NewCenturySchlbk-Roman"); |
| 25 |
|
| 26 |
pl_fmove (.50,.50); # /* move to center */ |
| 27 |
$x = 0; |
| 28 |
while ($x++ < 1000) # /* loop endlessly */ |
| 29 |
{ |
| 30 |
pl_erase (); |
| 31 |
pl_textangle($angle++); # /* set new rotation angle */ |
| 32 |
pl_alabel(ord 'c', ord 'c', "Hello"); # /* draw a centered `A' */ |
| 33 |
} |
| 34 |
pl_closepl(); # /* close Plotter */ |
| 35 |
pl_selectpl (0); # /* select default Plotter */ |
| 36 |
pl_deletepl ($handle); |
| 37 |
|
| 38 |
1; # OK |