Mercurial > octave
changeset 22488:a666e3ee6af8
Require gnuplot 4.4 as mininimum supported version.
* NEWS: Announce change.
* README.MacOS, README.gnuplot: Update minimum version to 4.4.
* image.m: Remove documentation referencing gnuplot 4.0.
* __bar__.m: Remove hack to width of bars done to avoid clipping in
gnuplot 4.0.
* __quiver__.m: Remove FIXME about gnuplot that is no longer correct.
* __gnuplot_drawnow__.m: Remove __gnuplot_has_feature__ tests for
"windows_figure_position", "x11_figure_position", "wxt_figure_size",
"has_termoption_dashed".
* graphics_toolkit.m: Remove FIXME note about gnuplot < 4.2.5.
* __gnuplot_draw_axes__.m: Remove __gnuplot_has_feature__ tests for
"screen_coordinates_for_{lrtb}margin", "transparent_patches",
"transparent_surface", "key_has_font_properties".
* __gnuplot_has_feature__.m: Remove feature tests for
"x11_figure_position", "wxt_figure_size", "transparent_patches",
"transparent_surface", "epslatex_implies_eps_filesuffix",
"epslatexstandalone_terminal", "screen_coordinates_for_{lrtb}margin",
"variable_GPVAL_TERMINALS", "eey_has_font_properties",
"windows_figure_position", "has_termoption_dashed".
* __gnuplot_has_terminal__.m: Remove __gnuplot_has_feature__ tests for
"variable_GPVAL_TERMINALS".
* __gnuplot_print__.m: Remove __gnuplot_has_feature__ tests for
"epslatex_implies_eps_filesuffix".
* __print_parse_opts__.m: Remove __gnuplot_has_feature__ tests for
"epslatex_implies_eps_filesuffix".
author | Rik <rik@octave.org> |
---|---|
date | Wed, 14 Sep 2016 13:19:47 -0700 |
parents | 1b1e740be472 |
children | 93ea313301f9 |
files | NEWS etc/README.MacOS etc/README.gnuplot scripts/image/image.m scripts/plot/draw/private/__bar__.m scripts/plot/draw/private/__quiver__.m scripts/plot/util/__gnuplot_drawnow__.m scripts/plot/util/graphics_toolkit.m scripts/plot/util/private/__gnuplot_draw_axes__.m scripts/plot/util/private/__gnuplot_has_feature__.m scripts/plot/util/private/__gnuplot_has_terminal__.m scripts/plot/util/private/__gnuplot_print__.m scripts/plot/util/private/__print_parse_opts__.m |
diffstat | 13 files changed, 45 insertions(+), 138 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Wed Sep 14 12:45:52 2016 -0700 +++ b/NEWS Wed Sep 14 13:19:47 2016 -0700 @@ -16,6 +16,8 @@ Examples: 0b101 == 5 or 0B1100_0001 == 0xC1 + ** gnuplot 4.4 is now the minimum version supported by Octave. + ** The default set of colors used to plot lines has been updated to be compatible with Matlab's new default color scheme. The line plot color scheme can be set with the axes property "ColorOrder".
--- a/etc/README.MacOS Wed Sep 14 12:45:52 2016 -0700 +++ b/etc/README.MacOS Wed Sep 14 13:19:47 2016 -0700 @@ -222,7 +222,7 @@ fltk-aqua-shlibs glpk-dev glpk-shlibs - gnuplot (>= 4.2.6) + gnuplot (>= 4.4) graphicsmagick (<= 1.3.7) graphicsmagick-shlibs (<= 1.3.7) hdf5 (>= 1.6.5)
--- a/etc/README.gnuplot Wed Sep 14 12:45:52 2016 -0700 +++ b/etc/README.gnuplot Wed Sep 14 13:19:47 2016 -0700 @@ -1,12 +1,7 @@ -Octave works best with gnuplot 4.4 or higher, which is available from +Octave requires gnuplot 4.4 or higher, which is available from http://www.gnuplot.info. -In versions prior to 4.2.6 it is not possible to use the mouse to zoom in -on plots. This is a limitation of earlier versions of gnuplot, which are -unable to zoom when the data it plots is not stored in a file. - - John W. Eaton jwe@octave.org -Last updated: Tue Jan 4 18:55:56 PST 2011 +Last updated: Wed Sep 14 12:25:25 PDT 2016
--- a/scripts/image/image.m Wed Sep 14 12:45:52 2016 -0700 +++ b/scripts/image/image.m Wed Sep 14 13:19:47 2016 -0700 @@ -32,8 +32,6 @@ ## convenience, @var{x} and @var{y} may be specified as N-element vectors ## matching the length of the data in @var{img}. However, only the first and ## last elements will be used to determine the axis limits. -## @strong{Warning:} @var{x} and @var{y} are ignored when using gnuplot 4.0 -## or earlier. ## ## Multiple property/value pairs may be specified for the image object, but ## they must appear in pairs. @@ -133,8 +131,7 @@ ## Generic image creation. ## ## The axis values corresponding to the matrix elements are specified in -## @var{x} and @var{y}. If you're not using gnuplot 4.2 or later, these -## variables are ignored. +## @var{x} and @var{y}. ## Author: Tony Richardson <arichard@stark.cc.oh.us> ## Created: July 1994
--- a/scripts/plot/draw/private/__bar__.m Wed Sep 14 12:45:52 2016 -0700 +++ b/scripts/plot/draw/private/__bar__.m Wed Sep 14 13:19:47 2016 -0700 @@ -27,8 +27,7 @@ [hax, varargin, nargin] = __plt_get_axis_arg__ (func, varargin{:}); - ## Slightly smaller than 0.8 to avoid clipping issue in gnuplot 4.0 - width = 0.8 - 10 * eps; + width = 0.8; group = true; histc = NA; bv = 0; # BaseValue
--- a/scripts/plot/draw/private/__quiver__.m Wed Sep 14 12:45:52 2016 -0700 +++ b/scripts/plot/draw/private/__quiver__.m Wed Sep 14 13:19:47 2016 -0700 @@ -259,7 +259,6 @@ h3 = plot (x, y, "linestyle", "none", "marker", mk, "parent", hg); endif if (have_filled) - ## FIXME: gnuplot doesn't respect the markerfacecolor field set (h3, "markerfacecolor", get (h1, "color")); endif
--- a/scripts/plot/util/__gnuplot_drawnow__.m Wed Sep 14 12:45:52 2016 -0700 +++ b/scripts/plot/util/__gnuplot_drawnow__.m Wed Sep 14 13:19:47 2016 -0700 @@ -193,16 +193,8 @@ "epscairo", "epslatex", "fig", "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 - if (__gnuplot_has_feature__ ("wxt_figure_size")) - terminals_with_size{end+1} = "wxt"; - endif + "pslatex", "svg", "tikz", "windows", ... + "wxt", "x11"}; switch (term) case terminals_with_size size_str = sprintf ("size %.12g,%.12g", gnuplot_size); @@ -228,10 +220,7 @@ otherwise size_str = ""; endswitch - if ((strcmp (term, "x11") - && __gnuplot_has_feature__ ("x11_figure_position")) - || (strcmpi (term, "windows") - && __gnuplot_has_feature__ ("windows_figure_position"))) + if (strcmp (term, "x11") || strcmpi (term, "windows")) ## X11/Windows allows the window to be positioned as well. units = get (0, "units"); unwind_protect @@ -300,16 +289,6 @@ term_str = [term_str " " size_str]; endif endif - if (! __gnuplot_has_feature__ ("has_termoption_dashed")) - ## If "set termoption dashed" isn't available add "dashed" option - ## to the "set terminal ..." command, if it is supported. - if (any (strcmp (term, {"aqua", "cgm", "eepic", "emf", "epslatex", ... - "fig", "pcl5", "mp", "next", "openstep", ... - "pdf", "pdfcairo", "pngcairo", "postscript", ... - "pslatex", "pstext", "svg", "tgif", "x11"}))) - term_str = [term_str " dashed"]; - endif - endif if (any (strcmp (term, {"aqua", "wxt"}))) term_str = [term_str, " ", "dashlength 1"]; elseif (any (strcmp (term, {"epslatex", "postscript", "pslatex"}))) @@ -339,8 +318,7 @@ endif endif endif - if (__gnuplot_has_feature__ ("has_termoption_dashed") - && ! __gnuplot_has_feature__ ("dashtype")) + if (! __gnuplot_has_feature__ ("dashtype")) fprintf (plot_stream, "set termoption dashed\n"); endif else
--- a/scripts/plot/util/graphics_toolkit.m Wed Sep 14 12:45:52 2016 -0700 +++ b/scripts/plot/util/graphics_toolkit.m Wed Sep 14 13:19:47 2016 -0700 @@ -82,8 +82,6 @@ endif if (! any (strcmp (loaded_graphics_toolkits (), name))) - ## FIXME: Special gnuplot handling for versions < 4.2.5 (bug #44978). - ## This can probably be deleted in the future once RHEL upgrades gnuplot. if (strcmp (name, "gnuplot")) valid_version = __gnuplot_has_feature__ ("minimum_version"); if (valid_version != 1)
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m Wed Sep 14 12:45:52 2016 -0700 +++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m Wed Sep 14 13:19:47 2016 -0700 @@ -83,43 +83,21 @@ endif if (strcmp (axis_obj.activepositionproperty, "position")) - if (__gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) - if (nd == 2 || all (mod (axis_obj.view, 90) == 0)) - x = [1, 1]; - else - ## 3D plots need to be sized down to fit in the window. - x = 1.0 ./ sqrt ([2, 2.5]); - endif - fprintf (plot_stream, "set tmargin screen %.15g;\n", - pos(2)+pos(4)/2+x(2)*pos(4)/2); - fprintf (plot_stream, "set bmargin screen %.15g;\n", - pos(2)+pos(4)/2-x(2)*pos(4)/2); - fprintf (plot_stream, "set lmargin screen %.15g;\n", - pos(1)+pos(3)/2-x(1)*pos(3)/2); - fprintf (plot_stream, "set rmargin screen %.15g;\n", - pos(1)+pos(3)/2+x(1)*pos(3)/2); - sz_str = ""; + if (nd == 2 || all (mod (axis_obj.view, 90) == 0)) + x = [1, 1]; else - fprintf (plot_stream, "set tmargin 0;\n"); - fprintf (plot_stream, "set bmargin 0;\n"); - fprintf (plot_stream, "set lmargin 0;\n"); - fprintf (plot_stream, "set rmargin 0;\n"); - - if (nd == 3 && all (axis_obj.view == [0, 90])) - ## FIXME: Kludge to allow colorbar to be added to a pcolor() plot - pos(3:4) = pos(3:4) * 1.4; - pos(1:2) = pos(1:2) - pos(3:4) * 0.125; - endif - - fprintf (plot_stream, "set origin %.15g, %.15g;\n", pos(1), pos(2)); - - if (strcmp (axis_obj.dataaspectratiomode, "manual")) - sz_str = sprintf ("set size ratio %.15g", -dr); - else - sz_str = "set size noratio"; - endif - sz_str = sprintf ("%s %.15g, %.15g;\n", sz_str, pos(3), pos(4)); + ## 3D plots need to be sized down to fit in the window. + x = 1.0 ./ sqrt ([2, 2.5]); endif + fprintf (plot_stream, "set tmargin screen %.15g;\n", + pos(2)+pos(4)/2+x(2)*pos(4)/2); + fprintf (plot_stream, "set bmargin screen %.15g;\n", + pos(2)+pos(4)/2-x(2)*pos(4)/2); + fprintf (plot_stream, "set lmargin screen %.15g;\n", + pos(1)+pos(3)/2-x(1)*pos(3)/2); + fprintf (plot_stream, "set rmargin screen %.15g;\n", + pos(1)+pos(3)/2+x(1)*pos(3)/2); + sz_str = ""; else ## activepositionproperty == outerposition fprintf (plot_stream, "unset tmargin;\n"); fprintf (plot_stream, "unset bmargin;\n"); @@ -885,8 +863,7 @@ [[xcol; xcol(end)], [ycol; ycol(end)], ... [zcol; zcol(end)], [ccdat; ccdat(end)]]']; else - if (__gnuplot_has_feature__ ("transparent_patches") - && isscalar (obj.facealpha)) + if (isscalar (obj.facealpha)) colorspec = sprintf ("lc rgb \"#%02x%02x%02x\" fillstyle transparent solid %f", round (255*color), obj.facealpha); else @@ -937,8 +914,7 @@ ec = obj.edgecolor; endif - if ((strcmp (ec, "flat") - || strcmp (ec, "interp")) + if ((strcmp (ec, "flat") || strcmp (ec, "interp")) && isfield (obj, "cdata")) if (ndims (obj.cdata) == 2 && (columns (obj.cdata) == nc @@ -1310,8 +1286,7 @@ dord = "depthorder"; endif - if (__gnuplot_has_feature__ ("transparent_surface") - && isscalar (obj.facealpha)) + if (isscalar (obj.facealpha)) fprintf (plot_stream, "set style fill transparent solid %f;\n", obj.facealpha); @@ -1635,13 +1610,9 @@ otherwise pos = ""; endswitch - if (__gnuplot_has_feature__ ("key_has_font_properties")) - [fontname, fontsize] = get_fontname_and_size (hlgnd); - fontspacespec = [create_spacingspec(fontname, fontsize, gnuplot_term),... - ' ', create_fontspec(fontname, fontsize, gnuplot_term)]; - else - fontspacespec = ""; - endif + [fontname, fontsize] = get_fontname_and_size (hlgnd); + fontspacespec = [create_spacingspec(fontname, fontsize, gnuplot_term),... + ' ', create_fontspec(fontname, fontsize, gnuplot_term)]; textcolors = get (findobj (hlgnd.children, "type", "text"), "color"); if (iscell (textcolors)) textcolors = cell2mat (textcolors);
--- a/scripts/plot/util/private/__gnuplot_has_feature__.m Wed Sep 14 12:45:52 2016 -0700 +++ b/scripts/plot/util/private/__gnuplot_has_feature__.m Wed Sep 14 13:19:47 2016 -0700 @@ -26,17 +26,6 @@ function res = __gnuplot_has_feature__ (feature) persistent features = {"minimum_version", - "x11_figure_position", - "wxt_figure_size", - "transparent_patches", - "transparent_surface", - "epslatex_implies_eps_filesuffix", - "epslatexstandalone_terminal", - "screen_coordinates_for_{lrtb}margin", - "variable_GPVAL_TERMINALS", - "key_has_font_properties", - "windows_figure_position", - "has_termoption_dashed", "needs_color_with_postscript", "linetype", "dashtype", @@ -50,8 +39,8 @@ ## Don't throw an error if gnuplot isn't installed gnuplot_version = "0.0.0"; end_try_catch - versions = {"4.2.5", "4.2.5", "4.4", "4.4", "4.4", "4.2", "4.2", "4.4", "4.4", "4.4", "4.4", "4.3", "4.6", "4.6", "5.0", "4.6"}; - operators = { ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; + versions = {"4.4", "4.6", "4.6", "5.0", "4.6"}; + operators = {">=", ">=", ">=", ">=", ">="}; have_features = false (size (features)); for n = 1 : numel (have_features) has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n});
--- a/scripts/plot/util/private/__gnuplot_has_terminal__.m Wed Sep 14 12:45:52 2016 -0700 +++ b/scripts/plot/util/private/__gnuplot_has_terminal__.m Wed Sep 14 13:19:47 2016 -0700 @@ -29,34 +29,19 @@ term = strtrim (term); term = lower (strtok (term, " ")); - if (__gnuplot_has_feature__ ("variable_GPVAL_TERMINALS")) - if (nargin < 2) - plot_stream = __gnuplot_open_stream__ (2); + if (nargin < 2) + plot_stream = __gnuplot_open_stream__ (2); + endif + available_terminals = __gnuplot_get_var__ (plot_stream, "GPVAL_TERMINALS"); + available_terminals = regexp (available_terminals, '\w+', "match"); + if (nargin < 2 && ! isempty (plot_stream)) + pclose (plot_stream(1)); + if (numel (plot_stream) > 1) + pclose (plot_stream(2)); endif - available_terminals = __gnuplot_get_var__ (plot_stream, "GPVAL_TERMINALS"); - available_terminals = regexp (available_terminals, '\w+', "match"); - if (nargin < 2 && ! isempty (plot_stream)) - pclose (plot_stream(1)); - if (numel (plot_stream) > 1) - pclose (plot_stream(2)); - endif - if (numel (plot_stream) > 2) - waitpid (plot_stream(3)); - endif + if (numel (plot_stream) > 2) + waitpid (plot_stream(3)); endif - else - ## Gnuplot 4.0 terminals. No new terminals were added until 4.4 which - ## allows the list of terminals to be obtained from GPVAL_TERMINALS. - available_terminals = {"aifm", "aqua", "canvas", "cgm", "corel", ... - "dumb", "dxf", "eepic", "emf", "epslatex", ... - "epson_180dpi", "fig", "gif", "gnugraph", ... - "gpic", "hp2623A", "hp2648", "hp500c", ... - "hpgl", "hpljii", "hppj", "imagen", "jpeg", ... - "latex", "mf", "mif", "mp", "pbm", "pdf", ... - "pm", "png", "postscript", "pslatex", ... - "pstex", "pstricks", "qms", "regis", "rgip", ... - "svg", "texdraw", "tgif", "tkcanvas", ... - "tpic", "windows", "x11", "xlib", "xterm"}; endif gnuplot_supports_term = any (strcmp (term, available_terminals));
--- a/scripts/plot/util/private/__gnuplot_print__.m Wed Sep 14 12:45:52 2016 -0700 +++ b/scripts/plot/util/private/__gnuplot_print__.m Wed Sep 14 13:19:47 2016 -0700 @@ -87,12 +87,7 @@ "invalid suffix '%s' for device '%s'.", ext, lower (opts.devopt)); endif - if (__gnuplot_has_feature__ ("epslatex_implies_eps_filesuffix")) - suffix = "tex"; - else - ## Gnuplot 4.0 wants a ".eps" suffix. - suffix = "eps"; - endif + suffix = "tex"; if (strfind (opts.devopt, "standalone")) gp_opts = sprintf ("standalone %s", gp_opts); term = strrep (opts.devopt, "standalone", "");
--- a/scripts/plot/util/private/__print_parse_opts__.m Wed Sep 14 12:45:52 2016 -0700 +++ b/scripts/plot/util/private/__print_parse_opts__.m Wed Sep 14 13:19:47 2016 -0700 @@ -250,8 +250,7 @@ __graphics_toolkit__ = get (0, "defaultfigure__graphics_toolkit__"); endif - if (strcmp (__graphics_toolkit__, "gnuplot") - && __gnuplot_has_feature__ ("epslatex_implies_eps_filesuffix")) + if (strcmp (__graphics_toolkit__, "gnuplot")) suffixes(strncmp (dev_list, "epslatex", 8)) = {"eps"}; endif