diff scripts/plot/__gnuplot_get_var__.m @ 9113:4bb94a71913b

__gnuplot_open_stream__.m: New function and its application.
author Ben Abbott <bpabbott@mac.com>
date Sun, 12 Apr 2009 20:40:53 -0400
parents d0d507cbd123
children 38ad8c99d6a2
line wrap: on
line diff
--- a/scripts/plot/__gnuplot_get_var__.m
+++ b/scripts/plot/__gnuplot_get_var__.m
@@ -37,7 +37,11 @@
   endif
 
   if (numel (h) == 1 && isfigure (h))
-    ostream = get (h, "__plot_stream__");
+    if (isempty (get (gcf, "__plot_stream__")))
+      ostream = __gnuplot_open_stream__ (2, h);
+    else
+      ostream = get (h, "__plot_stream__");
+    endif
   else
     ostream = h;
   endif