changeset 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 f914834836e7
children 9f5e095555fc
files scripts/ChangeLog scripts/plot/gnuplot_drawnow.m
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Tue Mar 24 11:29:53 2009 -0400
+++ b/scripts/ChangeLog	Tue Mar 24 19:41:56 2009 -0400
@@ -1,3 +1,8 @@
+2009-03-24  Ben Abbott <bpabbott@mac.com>
+
+	* plot/gnuplot_drawnow.m: When printing, pass scalar plot_stream
+	to __gnuplot_draw_figure__, and close all plot streams when done.
+
 2009-03-24  John W. Eaton  <jwe@octave.org>
 
 	* general/isa.m: Handle parent classes.
--- 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);