# HG changeset patch # User Markus Mützel # Date 1653659828 -7200 # Node ID 7c4e580bc103ded00fbceb8880c897f1990c4c07 # Parent 399925c27b7c6198a8752ec7de9359a1246e7ea9 plot: Deprecate using numbers to select line colors (bug #62470). * scripts/plot/util/__pltopt__.m (decode_linespec): Deprecate un-documented marker style and color identifiers. * etc/NEWS.7.md: Add note about deprecated feature to NEWS file. diff -r 399925c27b7c -r 7c4e580bc103 etc/NEWS.7.md --- a/etc/NEWS.7.md Fri May 27 14:46:29 2022 +0200 +++ b/etc/NEWS.7.md Fri May 27 15:57:08 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 399925c27b7c -r 7c4e580bc103 scripts/plot/util/__pltopt__.m --- a/scripts/plot/util/__pltopt__.m Fri May 27 14:46:29 2022 +0200 +++ b/scripts/plot/util/__pltopt__.m Fri May 27 15:57:08 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,10 +187,13 @@ n = 9; endif endif - ## Backward compatibility. Leave undocumented. - if (topt == "@") - topt = "+"; - endif + ## Backward compatibility. Leave undocumented. + if (topt == "@") + warning ("Octave:deprecated-option", ... + "%s: marker type '@' is deprecated. Use '+' instead.", ... + caller); + topt = "+"; + endif options.marker = topt; ## Numeric color specs are for backward compatibility. Don't document. elseif (topt == "k" || topt == "0")