Mercurial > octave
diff scripts/plot/util/__pltopt__.m @ 31035:7c4e580bc103 stable
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.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Fri, 27 May 2022 15:57:08 +0200 |
parents | 399925c27b7c |
children | a357490263f6 |
line wrap: on
line diff
--- 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")