From 13d6528473716f0f6fab707904008d2fda04902b Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Tue, 11 Aug 2009 14:11:24 -0700 Subject: [PATCH] don't try to plot empty curves Ignore-this: 8595770256deec271d0a7715a0e1ed14 darcs-hash:20090811211124-0cb85-8e26b73e0bb0071e246d2fe80512203c1152ac1f.gz --- driveGnuPlots.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driveGnuPlots.pl b/driveGnuPlots.pl index 9baab66..f48d318 100755 --- a/driveGnuPlots.pl +++ b/driveGnuPlots.pl @@ -230,12 +230,13 @@ sub plotStoredData my ($xmin, $xmax) = @_; print PIPE "set xrange [$xmin:$xmax]\n" if defined $xmin; - my @extraopts = map {$_->{"extraopts"}} @curves; + my @extraopts = map {$_->{"extraopts"}} grep {@{$_->{"data"}}} @curves; print PIPE 'plot ' . join(', ' , map({ '"-"' . $_} @extraopts) ) . "\n"; foreach my $curve (@curves) { my $buf = $curve->{"data"}; + next unless @$buf; for my $elem (@$buf) { my ($x, $y) = @$elem; print PIPE "$x $y\n";