# HG changeset patch # User Markus Mützel # Date 1653659890 -7200 # Node ID a357490263f68ade5a03021341b9b698e8829de9 # Parent bb9c7512e090b7ea276d64e5e6a3658d51026dbb# Parent 7c4e580bc103ded00fbceb8880c897f1990c4c07 maint: Merge stable to default. diff -r bb9c7512e090 -r a357490263f6 etc/NEWS.7.md --- a/etc/NEWS.7.md Thu May 26 19:47:47 2022 +0200 +++ b/etc/NEWS.7.md Fri May 27 15:58:10 2022 +0200 @@ -362,6 +362,10 @@ and a warning is now emitted if it is used, but it will continue to work. +- Using numbers to select line colors in short hand formats was an + un-documented feature that is deprecated in Octave 7 and will be + removed from Octave 9. + ### Removed functions, properties, and features diff -r bb9c7512e090 -r a357490263f6 scripts/plot/util/__pltopt__.m --- a/scripts/plot/util/__pltopt__.m Thu May 26 19:47:47 2022 +0200 +++ b/scripts/plot/util/__pltopt__.m Fri May 27 15:58:10 2022 +0200 @@ -158,6 +158,12 @@ topt = opt(1); n = 1; + if (any (topt == "0":"6")) + warning ("Octave:deprecated-option", ... + ["%s: using numbers to select line colors is deprecated. ", ... + "Use the corresponding color identifier instead."], caller); + endif + ## LineStyles if (strncmp (opt, "--", 2) || strncmp (opt, "-.", 2)) options.linestyle = opt(1:2); @@ -181,21 +187,28 @@ n = 9; endif endif + ## Backward compatibility. Leave undocumented. + if (topt == "@") + warning ("Octave:deprecated-option", ... + "%s: marker type '@' is deprecated. Use '+' instead.", ... + caller); + topt = "+"; + endif options.marker = topt; - ## Color specs - elseif (topt == "k") + ## Numeric color specs are for backward compatibility. Don't document. + elseif (topt == "k" || topt == "0") options.color = [0, 0, 0]; - elseif (topt == "r") + elseif (topt == "r" || topt == "1") if (strncmp (opt, "red", 3)) n = 3; endif options.color = [1, 0, 0]; - elseif (topt == "g") + elseif (topt == "g" || topt == "2") if (strncmp (opt, "green", 5)) n = 5; endif options.color = [0, 1, 0]; - elseif (topt == "b") + elseif (topt == "b" || topt == "3") if (strncmp (opt, "black", 5)) options.color = [0, 0, 0]; n = 5; @@ -210,17 +223,17 @@ n = 6; endif options.color = [1, 1, 0]; - elseif (topt == "m") + elseif (topt == "m" || topt == "4") if (strncmp (opt, "magenta", 7)) n = 7; endif options.color = [1, 0, 1]; - elseif (topt == "c") + elseif (topt == "c" || topt == "5") if (strncmp (opt, "cyan", 4)) n = 4; endif options.color = [0, 1, 1]; - elseif (topt == "w") + elseif (topt == "w" || topt == "6") if (strncmp (opt, "white", 5)) n = 5; endif