From 3e6fabaf971cf214954b6a2cd0346c71544ee8a8 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Tue, 15 Sep 2009 12:44:23 -0700 Subject: [PATCH] fix handling of empty curves Ignore-this: b898c03e4df23a2d9c6c5fad7065aff4 darcs-hash:20090915194423-0cb85-e00bbfe44ec500ed844e2275571a9170bcd5e4aa.gz --- driveGnuPlots.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/driveGnuPlots.pl b/driveGnuPlots.pl index 1162628..d535735 100755 --- a/driveGnuPlots.pl +++ b/driveGnuPlots.pl @@ -268,11 +268,12 @@ sub plotStoredData print PIPE "set xrange [$xmin:$xmax]\n" if defined $xmin; # get the options for those curves that have any data - my @extraopts = map {$_->[0]} grep {@$_ > 1} @curves; + my @nonemptyCurves = grep {@$_ > 1} @curves; + my @extraopts = map {$_->[0]} @nonemptyCurves; print PIPE 'plot ' . join(', ' , map({ '"-"' . $_} @extraopts) ) . "\n"; - foreach my $buf (@curves) + foreach my $buf (@nonemptyCurves) { # send each point to gnuplot. Ignore the first "point" since it's the # options string