1#! /usr/bin/perl 2 3my $col = shift; 4my $col_num; 5 6 if ($col eq "speed") { $col_num = 2; } 7elsif ($col eq "mem") { $col_num = 3; } 8elsif ($col eq "unusedmem") { $col_num = 4; } 9else { die "Format: $0 speed|mem|unusedmem [filenames...]\n"; } 10 11$col = ucfirst(lc($col)); 12 13print <<EOL; 14 15# set data style dots 16# set xrange [0:500] 17# set yrange [0:0.004] 18# replot 19 20set xlabel "Length" 21set ylabel "$col" 22 23EOL 24 25my @plots = (); 26for (@ARGV) 27{ 28 push(@plots, '"' . $_ . '" using 1:' . $col_num); 29} 30 31print "plot " . (join ", ", @plots) . "\n"; 32 33