comparison scripts/plot/__gnuplot_drawnow__.m @ 14461:80e8c03548a4 gui

Merge default onto gui
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 13 Mar 2012 19:11:52 -0400
parents d738c29a2528 12d13534265c
children e4d380c01dcf
comparison
equal deleted inserted replaced
14379:d738c29a2528 14461:80e8c03548a4
195 if (all (gnuplot_size > 0)) 195 if (all (gnuplot_size > 0))
196 terminals_with_size = {"canvas", "emf", "epslatex", "fig", ... 196 terminals_with_size = {"canvas", "emf", "epslatex", "fig", ...
197 "gif", "jpeg", "latex", "pbm", "pdf", ... 197 "gif", "jpeg", "latex", "pbm", "pdf", ...
198 "pdfcairo", "postscript", "png", "pngcairo", ... 198 "pdfcairo", "postscript", "png", "pngcairo", ...
199 "pstex", "pslatex", "svg", "tikz"}; 199 "pstex", "pslatex", "svg", "tikz"};
200 if (__gnuplot_has_feature__ ("windows_figure_position"))
201 terminals_with_size{end+1} = "windows";
202 endif
200 if (__gnuplot_has_feature__ ("x11_figure_position")) 203 if (__gnuplot_has_feature__ ("x11_figure_position"))
201 terminals_with_size{end+1} = "x11"; 204 terminals_with_size{end+1} = "x11";
202 endif 205 endif
203 if (__gnuplot_has_feature__ ("wxt_figure_size")) 206 if (__gnuplot_has_feature__ ("wxt_figure_size"))
204 terminals_with_size{end+1} = "wxt"; 207 terminals_with_size{end+1} = "wxt";
224 case "dxf" 227 case "dxf"
225 size_str = ""; 228 size_str = "";
226 otherwise 229 otherwise
227 size_str = ""; 230 size_str = "";
228 endswitch 231 endswitch
229 if (strncmpi (term, "x11", 3) 232 if ((strncmpi (term, "x11", 3)
230 && __gnuplot_has_feature__ ("x11_figure_position")) 233 && __gnuplot_has_feature__ ("x11_figure_position"))
231 ## X11 allows the window to be positioned as well. 234 || (strcmpi (term, "windows")
235 && __gnuplot_has_feature__ ("windows_figure_position")))
236 ## X11/Windows allows the window to be positioned as well.
232 units = get (0, "units"); 237 units = get (0, "units");
233 unwind_protect 238 unwind_protect
234 set (0, "units", "pixels"); 239 set (0, "units", "pixels");
235 screen_size = get (0, "screensize")(3:4); 240 screen_size = get (0, "screensize")(3:4);
236 unwind_protect_cleanup 241 unwind_protect_cleanup
237 set (0, "units", units); 242 set (0, "units", units);
238 end_unwind_protect 243 end_unwind_protect
239 if (all (screen_size > 0)) 244 if (all (screen_size > 0))
240 ## For X11, set the figure positon as well as the size 245 ## For X11/Windows, set the figure positon as well as the size
241 ## gnuplot position is UL, Octave's is LL (same for screen/window) 246 ## gnuplot position is UL, Octave's is LL (same for screen/window)
242 gnuplot_pos(2) = screen_size(2) - gnuplot_pos(2) - gnuplot_size(2); 247 gnuplot_pos(2) = screen_size(2) - gnuplot_pos(2) - gnuplot_size(2);
243 gnuplot_pos = max (gnuplot_pos, 1); 248 gnuplot_pos = max (gnuplot_pos, 1);
244 size_str = sprintf ("%s position %d,%d", size_str, 249 size_str = sprintf ("%s position %d,%d", size_str,
245 gnuplot_pos(1), gnuplot_pos(2)); 250 gnuplot_pos(1), gnuplot_pos(2));