Mercurial > hg > octave-lyh
comparison scripts/plot/gnuplot_drawnow.m @ 8610:85c9906abfd1
use endif and endfor instead of end
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 27 Jan 2009 23:17:37 -0500 |
parents | c7e49bf03d42 |
children | ff7d90d92db8 |
comparison
equal
deleted
inserted
replaced
8609:fcf762ba66cf | 8610:85c9906abfd1 |
---|---|
121 fig.name = get (h, "name"); | 121 fig.name = get (h, "name"); |
122 if (strcmpi (get (h, "numbertitle"), "on")) | 122 if (strcmpi (get (h, "numbertitle"), "on")) |
123 title_str = sprintf ("Figure %d", h); | 123 title_str = sprintf ("Figure %d", h); |
124 else | 124 else |
125 title_str = ""; | 125 title_str = ""; |
126 end | 126 endif |
127 if (! isempty (fig.name) && ! isempty (title_str)) | 127 if (! isempty (fig.name) && ! isempty (title_str)) |
128 title_str = sprintf ("%s: %s", title_str, fig.name); | 128 title_str = sprintf ("%s: %s", title_str, fig.name); |
129 elseif (! isempty (fig.name) && isempty (title_str)) | 129 elseif (! isempty (fig.name) && isempty (title_str)) |
130 title_str = fig.name; | 130 title_str = fig.name; |
131 end | 131 endif |
132 if (! isempty (title_str)) | 132 if (! isempty (title_str)) |
133 title_str = sprintf ("title \"%s\"", title_str); | 133 title_str = sprintf ("title \"%s\"", title_str); |
134 endif | 134 endif |
135 else | 135 else |
136 title_str = ""; | 136 title_str = ""; |
189 ## Set the gnuplot terminal (type, enhanced?, title, & size) | 189 ## Set the gnuplot terminal (type, enhanced?, title, & size) |
190 if (! isempty (term)) | 190 if (! isempty (term)) |
191 term_str = sprintf ("set terminal %s", term); | 191 term_str = sprintf ("set terminal %s", term); |
192 if (! isempty (enh_str)) | 192 if (! isempty (enh_str)) |
193 term_str = sprintf ("%s %s", term_str, enh_str); | 193 term_str = sprintf ("%s %s", term_str, enh_str); |
194 end | 194 endif |
195 if (! isempty (title_str)) | 195 if (! isempty (title_str)) |
196 term_str = sprintf ("%s %s", term_str, title_str); | 196 term_str = sprintf ("%s %s", term_str, title_str); |
197 end | 197 endif |
198 if (! isempty (size_str)) | 198 if (! isempty (size_str)) |
199 ## size_str goes last to permit specification of canvas size | 199 ## size_str goes last to permit specification of canvas size |
200 ## for terminals cdr/corel | 200 ## for terminals cdr/corel |
201 term_str = sprintf ("%s %s", term_str, size_str); | 201 term_str = sprintf ("%s %s", term_str, size_str); |
202 end | 202 endif |
203 if (nargin > 2 && ischar (opts_str)) | 203 if (nargin > 2 && ischar (opts_str)) |
204 ## Options must go last | 204 ## Options must go last |
205 term_str = sprintf ("%s %s", term_str, opts_str); | 205 term_str = sprintf ("%s %s", term_str, opts_str); |
206 endif | 206 endif |
207 fprintf (plot_stream, sprintf ("%s\n", term_str)); | 207 fprintf (plot_stream, sprintf ("%s\n", term_str)); |
208 else | 208 else |
209 ## gnuplot will pick up the GNUTERM environment variable itself | 209 ## gnuplot will pick up the GNUTERM environment variable itself |
210 ## so no need to set the terminal type if not also setting the | 210 ## so no need to set the terminal type if not also setting the |
211 ## figure title, enhanced mode, or position. | 211 ## figure title, enhanced mode, or position. |
212 end | 212 endif |
213 endif | 213 endif |
214 | 214 |
215 if (nargin == 4) | 215 if (nargin == 4) |
216 if (! isempty (file)) | 216 if (! isempty (file)) |
217 fprintf (plot_stream, "set output \"%s\";\n", file); | 217 fprintf (plot_stream, "set output \"%s\";\n", file); |