# HG changeset patch # User Shane Carr # Date 1362892409 21600 # Node ID 1dfc042804952d4d82ede99b6ca9baebf67183d4 # Parent 830f27544bb74b8af844307437d27f413c9fff52 Enabling outfile for gnuplot in drawnow diff --git a/scripts/plot/__gnuplot_drawnow__.m b/scripts/plot/__gnuplot_drawnow__.m --- a/scripts/plot/__gnuplot_drawnow__.m +++ b/scripts/plot/__gnuplot_drawnow__.m @@ -75,8 +75,13 @@ new_stream = false; endif term = gnuplot_default_term (plot_stream); - if (strcmp (term, "dumb")) - ## popen2 eats stdout of gnuplot, use temporary file instead + if (! isempty(getenv ("GNUOUT"))) + ## When GNUOUT is specified, tell GNUPlot to print to that filename + enhanced = gnuplot_set_term (plot_stream(1), new_stream, h, + term, getenv ("GNUOUT")); + elseif (strcmp (term, "dumb")) + ## dumb prints to stdout + ## popen2 eats stdout of gnuplot, so use temporary file instead dumb_tmp_file = tmpnam (); enhanced = gnuplot_set_term (plot_stream(1), new_stream, h, term, dumb_tmp_file);