mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Find gnuplot
This commit is contained in:
parent
fc8b9e3c05
commit
ce346ab569
@ -45,6 +45,16 @@ sub show_graph {
|
||||
|
||||
my $PNGFILE = "/tmp/gnuplot.$$";
|
||||
|
||||
# Find gnuplot, sorry this is for solaris.
|
||||
my $gnuplot;
|
||||
if(-f "/usr/bin/gnuplot") {
|
||||
$gnuplot = "/usr/bin/gnuplot";
|
||||
} elsif(-f "/usr/local/bin/gnuplot") {
|
||||
$gnuplot = "/usr/local/bin/gnuplot";
|
||||
} else {
|
||||
die "Can't find gnuplot.";
|
||||
}
|
||||
|
||||
# interpolate params into gnuplot command
|
||||
my $cmds = qq{
|
||||
reset
|
||||
@ -65,7 +75,7 @@ sub show_graph {
|
||||
plot "$DATAFILE" using 1:2 with points ls 1, "$DATAFILE" using 1:2 with lines ls 2
|
||||
};
|
||||
|
||||
open (GNUPLOT, "| /usr/bin/gnuplot") || die "can't fork: $!";
|
||||
open (GNUPLOT, "| $gnuplot") || die "can't fork: $!";
|
||||
print GNUPLOT $cmds;
|
||||
close (GNUPLOT) || die "can't close: $!";
|
||||
open (GNUPLOT, "< $PNGFILE") || die "can't read: $!";
|
||||
|
Loading…
Reference in New Issue
Block a user