Mercurial > octave
changeset 20883:c7d881aec36c
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 | 776c0b8c1d07 |
children | f1b2a2dbc0e1 |
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 Dec 12 18:25:55 2015 -0800 +++ 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 Dec 12 18:25:55 2015 -0800 +++ b/scripts/plot/util/private/__gnuplot_has_feature__.m Sat Dec 12 21:34:06 2015 -0500 @@ -36,7 +36,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)) @@ -46,8 +47,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"}; - operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; + 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", "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});