changeset 16890:8660bc2a50da gnuout

Enabling outfile for gnuplot in drawnow
author Shane Carr <shane.carr@wustl.edu>
date Sat, 09 Mar 2013 23:13:29 -0600
parents 2a81ce01c383
children 6431f38becdf
files scripts/plot/__gnuplot_drawnow__.m
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);