# HG changeset patch # User Ben Abbott # Date 1449974046 18000 # Node ID 8990b8c4f00a772fa29484626088b5ea570c5a5e # Parent a93fa1b0796e347fed23a9b2e650a57ac02dc3c2 For gnuplot 5.x, add the "color" option to the postscript terminal. (bug #42838). * scripts/plot/util/private/__gnuplot_has_feature__.m: Add a new feature, "needs_color_with_postscript". * scripts/plot/util/__gnuplot_drawnow__.m: Add the "color" option to the postscript terminal when using gnuplot 5.x. diff -r a93fa1b0796e -r 8990b8c4f00a scripts/plot/util/__gnuplot_drawnow__.m --- a/scripts/plot/util/__gnuplot_drawnow__.m Sat Jan 16 14:03:45 2016 +1100 +++ b/scripts/plot/util/__gnuplot_drawnow__.m Sat Dec 12 21:34:06 2015 -0500 @@ -268,6 +268,10 @@ ## Set the gnuplot terminal (type, enhanced, title, options & size). term_str = ["set terminal " term]; + if (__gnuplot_has_feature__ ("needs_color_with_postscript") ... + && strcmp (term, "postscript")) + term_str = [term_str, " color"]; + endif if (! isempty (enh_str)) term_str = [term_str " " enh_str]; endif diff -r a93fa1b0796e -r 8990b8c4f00a scripts/plot/util/private/__gnuplot_has_feature__.m --- a/scripts/plot/util/private/__gnuplot_has_feature__.m Sat Jan 16 14:03:45 2016 +1100 +++ b/scripts/plot/util/private/__gnuplot_has_feature__.m Sat Dec 12 21:34:06 2015 -0500 @@ -35,7 +35,8 @@ "variable_GPVAL_TERMINALS", "key_has_font_properties", "windows_figure_position", - "has_termoption_dashed"}; + "has_termoption_dashed", + "needs_color_with_postscript"}; persistent has_features; if (isempty (has_features)) @@ -45,8 +46,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", "4.4", "4.3"}; - operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; + versions = {"4.2.5", "4.4", "4.4", "4.4", "4.2", "4.2", "4.4", "4.4", "4.4", "4.4", "4.3", "5.0"}; + operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; have_features = false (size (features)); for n = 1 : numel (have_features) has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n});