diff scripts/plot/gnuplot_drawnow.m @ 9008:7a7cf569528d

gnuplot_drawnow.m: Check that gnuplot has internal variable "GPVAL_TERMINALS".
author Ben Abbott <bpabbott@mac.com>
date Mon, 23 Mar 2009 18:21:25 -0400
parents 5cc15e4b4e5c
children dd5725531732
line wrap: on
line diff
--- a/scripts/plot/gnuplot_drawnow.m	Mon Mar 23 14:23:48 2009 +0100
+++ b/scripts/plot/gnuplot_drawnow.m	Mon Mar 23 18:21:25 2009 -0400
@@ -41,10 +41,17 @@
     printing = ! output_to_screen (gnuplot_trim_term (term));
     unwind_protect
       plot_stream = open_gnuplot_stream (2, []);
-      available_terminals = __gnuplot_get_var__ (plot_stream, "GPVAL_TERMINALS");
-      available_terminals = regexp (available_terminals, "\\b\\w+\\b", "match");
-      if (any (strcmpi (available_terminals, gnuplot_trim_term (term))))
-        [enhanced, implicit_margin] = gnuplot_set_term (plot_stream (1), true, h, term, file);
+      if (__gnuplot_has_feature__ ("variable_GPVAL_TERMINALS"))
+        available_terminals = __gnuplot_get_var__ (plot_stream, "GPVAL_TERMINALS");
+        available_terminals = regexp (available_terminals, "\\b\\w+\\b", "match");
+        gnuplot_supports_term = any (strcmpi (available_terminals,
+                                              gnuplot_trim_term (term)));
+      else
+        gnuplot_supports_term = true;
+      endif
+      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);
         if (nargin == 5)
           fid = fopen (debug_file, "wb");