comparison 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
comparison
equal deleted inserted replaced
31034:399925c27b7c 31035:7c4e580bc103
155 endif 155 endif
156 156
157 while (! isempty (opt)) 157 while (! isempty (opt))
158 topt = opt(1); 158 topt = opt(1);
159 n = 1; 159 n = 1;
160
161 if (any (topt == "0":"6"))
162 warning ("Octave:deprecated-option", ...
163 ["%s: using numbers to select line colors is deprecated. ", ...
164 "Use the corresponding color identifier instead."], caller);
165 endif
160 166
161 ## LineStyles 167 ## LineStyles
162 if (strncmp (opt, "--", 2) || strncmp (opt, "-.", 2)) 168 if (strncmp (opt, "--", 2) || strncmp (opt, "-.", 2))
163 options.linestyle = opt(1:2); 169 options.linestyle = opt(1:2);
164 have_linestyle = true; 170 have_linestyle = true;
179 n = 8; 185 n = 8;
180 elseif (strncmp (opt, "pentagram", 9)) 186 elseif (strncmp (opt, "pentagram", 9))
181 n = 9; 187 n = 9;
182 endif 188 endif
183 endif 189 endif
184 ## Backward compatibility. Leave undocumented. 190 ## Backward compatibility. Leave undocumented.
185 if (topt == "@") 191 if (topt == "@")
186 topt = "+"; 192 warning ("Octave:deprecated-option", ...
187 endif 193 "%s: marker type '@' is deprecated. Use '+' instead.", ...
194 caller);
195 topt = "+";
196 endif
188 options.marker = topt; 197 options.marker = topt;
189 ## Numeric color specs are for backward compatibility. Don't document. 198 ## Numeric color specs are for backward compatibility. Don't document.
190 elseif (topt == "k" || topt == "0") 199 elseif (topt == "k" || topt == "0")
191 options.color = [0, 0, 0]; 200 options.color = [0, 0, 0];
192 elseif (topt == "r" || topt == "1") 201 elseif (topt == "r" || topt == "1")