Mercurial > hg > octave-nkf
changeset 14417:12d13534265c
Add support for figure positioning for gnuplot Windows terminals.
* __gnuplot_drawnow__.m: Support postion and size options for Windows term.
* __gnuplot_has_feature__.m: As of gnuplot-4.4.0 the Windows terminal accepts
the position and size options.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Tue, 28 Feb 2012 07:42:40 -0500 |
parents | 59e20a5e2ca8 |
children | 933101fd5cbb |
files | scripts/plot/__gnuplot_drawnow__.m scripts/plot/private/__gnuplot_has_feature__.m |
diffstat | 2 files changed, 13 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/__gnuplot_drawnow__.m +++ b/scripts/plot/__gnuplot_drawnow__.m @@ -197,6 +197,9 @@ "gif", "jpeg", "latex", "pbm", "pdf", ... "pdfcairo", "postscript", "png", "pngcairo", ... "pstex", "pslatex", "svg", "tikz"}; + if (__gnuplot_has_feature__ ("windows_figure_position")) + terminals_with_size{end+1} = "windows"; + endif if (__gnuplot_has_feature__ ("x11_figure_position")) terminals_with_size{end+1} = "x11"; endif @@ -226,9 +229,11 @@ otherwise size_str = ""; endswitch - if (strncmpi (term, "x11", 3) - && __gnuplot_has_feature__ ("x11_figure_position")) - ## X11 allows the window to be positioned as well. + if ((strncmpi (term, "x11", 3) + && __gnuplot_has_feature__ ("x11_figure_position")) + || (strcmpi (term, "windows") + && __gnuplot_has_feature__ ("windows_figure_position"))) + ## X11/Windows allows the window to be positioned as well. units = get (0, "units"); unwind_protect set (0, "units", "pixels"); @@ -237,7 +242,7 @@ set (0, "units", units); end_unwind_protect if (all (screen_size > 0)) - ## For X11, set the figure positon as well as the size + ## For X11/Windows, set the figure positon as well as the size ## gnuplot position is UL, Octave's is LL (same for screen/window) gnuplot_pos(2) = screen_size(2) - gnuplot_pos(2) - gnuplot_size(2); gnuplot_pos = max (gnuplot_pos, 1);
--- a/scripts/plot/private/__gnuplot_has_feature__.m +++ b/scripts/plot/private/__gnuplot_has_feature__.m @@ -34,7 +34,8 @@ "epslatexstandalone_terminal", "screen_coordinates_for_{lrtb}margin", "variable_GPVAL_TERMINALS", - "key_has_font_properties"}; + "key_has_font_properties", + "windows_figure_position"}; if (isempty (has_features)) try @@ -43,8 +44,8 @@ ## Don't throw an error if gnuplot isn't installed gnuplot_version = "0.0.0"; end_try_catch - versions = {"4.2.5", "4.4", "4.4", "4.4", "4.2", "4.2", "4.4", "4.4", "4.4"}; - operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; + versions = {"4.2.5", "4.4", "4.4", "4.4", "4.2", "4.2", "4.4", "4.4", "4.4", "4.4"}; + operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; have_features = logical (zeros (size (features))); for n = 1 : numel (have_features) has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n});