comparison 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
comparison
equal deleted inserted replaced
9007:7e31df9a0334 9008:7a7cf569528d
39 plot_stream = []; 39 plot_stream = [];
40 fid = []; 40 fid = [];
41 printing = ! output_to_screen (gnuplot_trim_term (term)); 41 printing = ! output_to_screen (gnuplot_trim_term (term));
42 unwind_protect 42 unwind_protect
43 plot_stream = open_gnuplot_stream (2, []); 43 plot_stream = open_gnuplot_stream (2, []);
44 available_terminals = __gnuplot_get_var__ (plot_stream, "GPVAL_TERMINALS"); 44 if (__gnuplot_has_feature__ ("variable_GPVAL_TERMINALS"))
45 available_terminals = regexp (available_terminals, "\\b\\w+\\b", "match"); 45 available_terminals = __gnuplot_get_var__ (plot_stream, "GPVAL_TERMINALS");
46 if (any (strcmpi (available_terminals, gnuplot_trim_term (term)))) 46 available_terminals = regexp (available_terminals, "\\b\\w+\\b", "match");
47 [enhanced, implicit_margin] = gnuplot_set_term (plot_stream (1), true, h, term, file); 47 gnuplot_supports_term = any (strcmpi (available_terminals,
48 gnuplot_trim_term (term)));
49 else
50 gnuplot_supports_term = true;
51 endif
52 if (gnuplot_supports_term)
53 [enhanced, implicit_margin] = gnuplot_set_term (plot_stream (1), true,
54 h, term, file);
48 __go_draw_figure__ (h, plot_stream, enhanced, mono, printing, implicit_margin); 55 __go_draw_figure__ (h, plot_stream, enhanced, mono, printing, implicit_margin);
49 if (nargin == 5) 56 if (nargin == 5)
50 fid = fopen (debug_file, "wb"); 57 fid = fopen (debug_file, "wb");
51 [enhanced, implicit_margin] = gnuplot_set_term (fid, true, h, term, file); 58 [enhanced, implicit_margin] = gnuplot_set_term (fid, true, h, term, file);
52 __go_draw_figure__ (h, fid, enhanced, mono, printing, implicit_margin); 59 __go_draw_figure__ (h, fid, enhanced, mono, printing, implicit_margin);