From bb9a00994ce7159304f7728d3d3291af5632c42e Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Wed, 4 Feb 2009 13:39:24 -0800 Subject: [PATCH] drivegnuplots: only output the header if we've data for this data set Ignore-this: effce8f31a4e9d8272927ed9faaf92c1 darcs-hash:20090204213924-0cb85-17f735f088325e37142d41dd987212c90e343950.gz --- driveGnuPlots.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/driveGnuPlots.pl b/driveGnuPlots.pl index 00c3cbc..e3e0f07 100755 --- a/driveGnuPlots.pl +++ b/driveGnuPlots.pl @@ -66,10 +66,10 @@ sub main { my $streamIdx = 0; select((select(STDOUT), $| = 1)[0]); my $xcounter = 0; - plotHeader($xcounter, $samples, $numberOfStreams, *PIPE); while(<>) { chomp; my $line = $_; + plotHeader($xcounter, $samples, $numberOfStreams, *PIPE) if($streamIdx == 0); foreach my $point ($line =~ /([-]?[0-9\.]+)/g) { my $buf = $buffers[$streamIdx]; @@ -92,7 +92,6 @@ sub main { if ($streamIdx == $numberOfStreams) { $streamIdx = 0; $xcounter++; - plotHeader($xcounter, $samples, $numberOfStreams, *PIPE); } } }