diff --git a/bin/feedGnuplot b/bin/feedGnuplot index 21b06de..d79e062 100755 --- a/bin/feedGnuplot +++ b/bin/feedGnuplot @@ -403,7 +403,10 @@ sub mainThread { next if /^#/o; - if($_ !~ /^replot/o) + if( $options{stream} && /^clear/o ) + { clearCurves(); } + + if(! /^replot/o) { # parse the incoming data lines. The format is # x id0 dat0 id1 dat1 .... @@ -606,6 +609,13 @@ sub setCurveLabel updateCurveOptions($curve->[0], $id); } +# remove all the curve data +sub clearCurves +{ + foreach my $curve(@curves) + { splice( @$curve, 1 ); } +} + # function to add a point to the plot. Assumes that the curve indexed by $idx already exists sub pushPoint {