changeset 21263:8990b8c4f00a stable

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.
author Ben Abbott <bpabbott@mac.com>
date Sat, 12 Dec 2015 21:34:06 -0500
parents a93fa1b0796e
children 48d82f74243e 1bbd799ac7c7
files scripts/plot/util/__gnuplot_drawnow__.m scripts/plot/util/private/__gnuplot_has_feature__.m
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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});