File: test7.p

package info (click to toggle)
libpgplot-perl 1%3A2.21-6
  • links: PTS, VCS
  • area: contrib
  • in suites: stretch
  • size: 316 kB
  • ctags: 31
  • sloc: perl: 679; ansic: 453; makefile: 7
file content (45 lines) | stat: -rwxr-xr-x 791 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/local/bin/perl

use PGPLOT;

print "\n\nTesting pghi2d routine...\n\n";

print "PGPLOT module version $PGPLOT::VERSION\n\n";

pgqinf("VERSION",$val,$len);
print "PGPLOT $val library\n\n";

# Read in image (int*2)

$img="";
open(IMG,"test.img") || die "Data file test.img not found";
if($^O =~ /mswin32/i) {binmode(IMG)}
read(IMG, $img, 32768);
close(IMG) or die "Can't close test.img: $!";

print length($img)," bytes read\n";

@image = unpack("n*",$img);

print $#image+1," element image stored\n";

$dev = "?" unless defined $dev; # "?" will prompt for device

pgbegin(0,$dev,1,1);

print "Plotting...\n";

pgenv(0,256,0,65000,0,0);

pgsci(5);

@xvals = (1..128);

@work = (1..128); 

pghi2d(\@image, 128, 128, 1,128,1,128, \@xvals, 1, 200, 1, \@work);

$len=1; # -w fudge

pgend;