# HG changeset patch # User Ben Abbott # Date 1237846885 14400 # Node ID 7a7cf569528db1231020ccb258c0b85204a081c7 # Parent 7e31df9a03347af359fedf8fa25cc9e79446edc1 gnuplot_drawnow.m: Check that gnuplot has internal variable "GPVAL_TERMINALS". diff -r 7e31df9a0334 -r 7a7cf569528d scripts/ChangeLog --- a/scripts/ChangeLog Mon Mar 23 14:23:48 2009 +0100 +++ b/scripts/ChangeLog Mon Mar 23 18:21:25 2009 -0400 @@ -1,3 +1,9 @@ +2009-03-23 Ben Abbott + + * plot/gnuplot_drawnow.m: Check that gnuplot has internal variable + "GPVAL_TERMINALS". + * plot/__gnuplot_has_feature__.m: Add "variable_GPVAL_TERMINALS". + 2009-03-21 Ben Abbott * plot/gnuplot_drawnow.m: Verify the gnuplot terminal is supported. diff -r 7e31df9a0334 -r 7a7cf569528d scripts/plot/__gnuplot_has_feature__.m --- a/scripts/plot/__gnuplot_has_feature__.m Mon Mar 23 14:23:48 2009 +0100 +++ b/scripts/plot/__gnuplot_has_feature__.m Mon Mar 23 18:21:25 2009 -0400 @@ -29,12 +29,13 @@ "transparent_surface", "epslatex_implies_eps_filesuffix", "epslatexstandalone_terminal", - "screen_coordinates_for_{lrtb}margin",}; + "screen_coordinates_for_{lrtb}margin", + "variable_GPVAL_TERMINALS"}; if (isempty (has_features)) gnuplot_version = __gnuplot_version__ (); - versions = {"4.2.4", "4.3", "4.3", "4.2", "4.2", "4.3"}; - operators = {">", ">=", ">=", ">=", ">=", ">="}; + versions = {"4.2.4", "4.3", "4.3", "4.2", "4.2", "4.3", "4.3"}; + operators = {">", ">=", ">=", ">=", ">=", ">=", ">="}; have_features = logical (zeros (size (features))); for n = 1 : numel (have_features) has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n}); diff -r 7e31df9a0334 -r 7a7cf569528d scripts/plot/gnuplot_drawnow.m --- 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");