From d7fd9db35634b8037c4ce519707ec56cca646887 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Thu, 27 Aug 2009 13:23:08 -0700 Subject: [PATCH] persistence for nostream Ignore-this: 8d8ed631ca050aa138ec640db05a84ef darcs-hash:20090827202308-0cb85-76575e918f2b3d47023c155ee2b2dea89d1526de.gz --- driveGnuPlots.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/driveGnuPlots.pl b/driveGnuPlots.pl index 0284e2f..dd7b827 100755 --- a/driveGnuPlots.pl +++ b/driveGnuPlots.pl @@ -113,7 +113,10 @@ sub plotThread sub mainThread { local *PIPE; - open PIPE, "|gnuplot --persist" || die "Can't initialize gnuplot\n"; + my $dopersist = ""; + $dopersist = "--persist" if(!$options{"stream"}); + + open PIPE, "|gnuplot $dopersist" || die "Can't initialize gnuplot\n"; autoflush PIPE 1; my $temphardcopyfile; @@ -237,6 +240,11 @@ sub mainThread { printf "Wrote output to $outputfile\n"; return; } + + # we persist gnuplot, so we shouldn't need this sleep. However, once + # gnuplot exist, but the persistent window sticks around, you can no + # longer interactively zoom the plot. So we still sleep + sleep(100000); } }