diff scripts/plot/gnuplot_drawnow.m @ 9011:dd5725531732

gnuplot_drawnow.m: When printing, pass scalar plot_stream to __gnuplot_draw_figure__, and close all plot streams when done.
author Ben Abbott <bpabbott@mac.com>
date Tue, 24 Mar 2009 19:41:56 -0400
parents 7a7cf569528d
children 8651fcc89556
line wrap: on
line diff
--- a/scripts/plot/gnuplot_drawnow.m	Tue Mar 24 11:29:53 2009 -0400
+++ b/scripts/plot/gnuplot_drawnow.m	Tue Mar 24 19:41:56 2009 -0400
@@ -52,7 +52,7 @@
       if (gnuplot_supports_term)
         [enhanced, implicit_margin] = gnuplot_set_term (plot_stream (1), true,
                                                         h, term, file);
-        __go_draw_figure__ (h, plot_stream, enhanced, mono, printing, implicit_margin);
+        __go_draw_figure__ (h, plot_stream(1), enhanced, mono, printing, implicit_margin);
         if (nargin == 5)
           fid = fopen (debug_file, "wb");
           [enhanced, implicit_margin] = gnuplot_set_term (fid, true, h, term, file);
@@ -64,7 +64,10 @@
       endif
     unwind_protect_cleanup
       if (! isempty (plot_stream))
-        pclose (plot_stream);
+        pclose (plot_stream(1));
+        if (numel (plot_stream) == 2)
+          pclose (plot_stream(2));
+        endif
       endif
       if (! isempty (fid))
         fclose (fid);