annotate scripts/plot/gnuplot_drawnow.m @ 8249:1f429086565c

[mq]: hidden-children
author John W. Eaton <jwe@octave.org>
date Tue, 21 Oct 2008 14:06:25 -0400
parents a0ec02774303
children d750feaefa8e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
1 ## Copyright (C) 2005, 2006, 2007 John W. Eaton
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
2 ##
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
4 ##
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
8 ## your option) any later version.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
9 ##
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
14 ##
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
18
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
19 ## -*- texinfo -*-
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
20 ## @deftypefn {Function File} {} drawnow ()
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
21 ## Update and display the current graphics.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
22 ##
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
23 ## Octave automatically calls drawnow just before printing a prompt,
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
24 ## when @code{sleep} or @code{pause} is called, or while waiting for
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
25 ## command-line input.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
26 ## @end deftypefn
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
27
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
28 ## Author: jwe
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
29
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
30 function gnuplot_drawnow (h, term, file, mono, debug_file)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
31
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
32 if (nargin < 4)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
33 mono = false;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
34 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
35
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
36 if (nargin >= 3 && nargin <= 5)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
37 plot_stream = [];
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
38 fid = [];
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
39 unwind_protect
7680
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
40 [plot_stream, enhanced] = open_gnuplot_stream (1, [], term, file);
8249
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 7680
diff changeset
41 __go_draw_figure__ (h, plot_stream, enhanced, mono);
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
42 if (nargin == 5)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
43 fid = fopen (debug_file, "wb");
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
44 enhanced = init_plot_stream (fid, [], term, file);
8249
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 7680
diff changeset
45 __go_draw_figure__ (h, fid, enhanced, mono);
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
46 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
47 unwind_protect_cleanup
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
48 if (! isempty (plot_stream))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
49 pclose (plot_stream);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
50 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
51 if (! isempty (fid))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
52 fclose (fid);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
53 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
54 end_unwind_protect
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
55 elseif (nargin == 1)
8249
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 7680
diff changeset
56 plot_stream = get (h, "__plot_stream__");
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
57 if (isempty (plot_stream))
7680
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
58 [plot_stream, enhanced] = open_gnuplot_stream (2, h);
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
59 set (h, "__enhanced__", enhanced);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
60 else
8249
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 7680
diff changeset
61 enhanced = get (h, "__enhanced__");
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
62 endif
8249
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 7680
diff changeset
63 __go_draw_figure__ (h, plot_stream (1), enhanced, mono);
7680
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
64 fflush (plot_stream (1));
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
65 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
66 print_usage ();
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
67 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
68
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
69 endfunction
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
70
7680
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
71 function [plot_stream, enhanced] = open_gnuplot_stream (npipes, h, varargin)
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
72
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
73 cmd = gnuplot_binary ();
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
74
7680
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
75 if (npipes > 1)
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
76 [plot_stream(1), plot_stream(2), pid] = popen2 (cmd);
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
77 if (pid < 0)
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
78 error ("drawnow: failed to open connection to gnuplot");
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
79 endif
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
80 else
7680
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
81 plot_stream = popen (cmd, "w");
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
82 if (plot_stream < 0)
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
83 error ("drawnow: failed to open connection to gnuplot");
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
84 endif
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
85 endif
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
86
7680
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
87 if (! isempty (h))
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
88 set (h, "__plot_stream__", plot_stream);
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
89 endif
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
90
7680
a0ec02774303 Use popen2 for communication with gnuplot
David Bateman <dbateman@free.fr>
parents: 7408
diff changeset
91 enhanced = init_plot_stream (plot_stream (1), h, varargin{:});
7408
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
92
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
93 endfunction
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
94
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
95 function enhanced = init_plot_stream (plot_stream, h, term, file)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
96
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
97 if (nargin == 4)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
98 enhanced = enhanced_term (term);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
99 if (! isempty (term))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
100 if (enhanced)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
101 fprintf (plot_stream, "set terminal %s enhanced;\n", term);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
102 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
103 fprintf (plot_stream, "set terminal %s;\n", term);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
104 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
105 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
106 if (! isempty (file))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
107 fprintf (plot_stream, "set output \"%s\";\n", file);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
108 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
109 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
110
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
111 ## Guess the terminal type.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
112 term = getenv ("GNUTERM");
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
113 if (isempty (term))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
114 if (! isempty (getenv ("DISPLAY")))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
115 term = "x11";
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
116 elseif (! isunix ())
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
117 term = "windows";
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
118 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
119 ## This should really be checking for os x before setting
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
120 ## the terminal type to aqua, but nobody will notice because
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
121 ## every other unix will be using x11 and windows will be
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
122 ## using windows. Those diehards still running octave from
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
123 ## a linux console know how to set the GNUTERM variable.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
124 term = "aqua";
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
125 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
126 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
127
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
128 enhanced = enhanced_term (term);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
129 if (enhanced)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
130 enh_str = "enhanced";
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
131 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
132 enh_str = "";
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
133 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
134
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
135 ## If no 'h' (why not?) then open the terminal as Figure 0.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
136 if (isempty (h))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
137 h = 0;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
138 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
139
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
140 if (strcmp (term, "x11"))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
141 fprintf (plot_stream, "set terminal x11 %s title \"Figure %d\"\n",
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
142 enh_str, h);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
143 elseif (strcmp (term, "aqua"))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
144 ## Aqua doesn't understand the 'title' option despite what the
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
145 ## gnuplot 4.2 documentation says.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
146 fprintf (plot_stream, "set terminal aqua %d %s\n", h, enh_str);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
147 elseif (strcmp (term, "wxt"))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
148 fprintf (plot_stream, "set terminal wxt %s title \"Figure %d\"\n",
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
149 enh_str, h);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
150
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
151 elseif (enhanced)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
152 fprintf (plot_stream, "set terminal %s %s\n", term, enh_str);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
153 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
154 ## gnuplot will pick up the GNUTERM environment variable itself
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
155 ## so no need to set the terminal type if not also setting the
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
156 ## figure title or enhanced mode.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
157
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
158 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
159
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
160 endfunction
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
161
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
162 function have_enhanced = enhanced_term (term)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
163 persistent enhanced_terminals;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
164
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
165 if (isempty (enhanced_terminals))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
166 ## Don't include pstex, pslatex or epslatex here as the TeX commands
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
167 ## should not be interpreted in that case.
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
168 if (compare_versions (__gnuplot_version__ (), "4.0", ">"))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
169 enhanced_terminals = {"aqua", "dumb", "png", "jpeg", "gif", "pm", ...
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
170 "windows", "wxt", "svg", "postscript", "x11", "pdf"};
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
171 else
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
172 enhanced_terminals = {"x11", "postscript"};
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
173 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
174 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
175
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
176 term = tolower (term);
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
177
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
178 have_enhanced = false;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
179 for i = 1 : length (enhanced_terminals)
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
180 t = enhanced_terminals{i};
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
181 if (strncmp (term, t, min (length (term), length (t))))
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
182 have_enhanced = true;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
183 break;
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
184 endif
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
185 endfor
246f905cb984 [project @ 2008-01-22 19:42:47 by jwe]
jwe
parents:
diff changeset
186 endfunction