Mercurial > octave
comparison scripts/plot/util/__pltopt__.m @ 31036:a357490263f6
maint: Merge stable to default.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Fri, 27 May 2022 15:58:10 +0200 |
parents | 5d3faba0342e 7c4e580bc103 |
children | c17155495497 597f3ee61a48 |
comparison
equal
deleted
inserted
replaced
31033:bb9c7512e090 | 31036:a357490263f6 |
---|---|
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 |
190 ## Backward compatibility. Leave undocumented. | |
191 if (topt == "@") | |
192 warning ("Octave:deprecated-option", ... | |
193 "%s: marker type '@' is deprecated. Use '+' instead.", ... | |
194 caller); | |
195 topt = "+"; | |
196 endif | |
184 options.marker = topt; | 197 options.marker = topt; |
185 ## Color specs | 198 ## Numeric color specs are for backward compatibility. Don't document. |
186 elseif (topt == "k") | 199 elseif (topt == "k" || topt == "0") |
187 options.color = [0, 0, 0]; | 200 options.color = [0, 0, 0]; |
188 elseif (topt == "r") | 201 elseif (topt == "r" || topt == "1") |
189 if (strncmp (opt, "red", 3)) | 202 if (strncmp (opt, "red", 3)) |
190 n = 3; | 203 n = 3; |
191 endif | 204 endif |
192 options.color = [1, 0, 0]; | 205 options.color = [1, 0, 0]; |
193 elseif (topt == "g") | 206 elseif (topt == "g" || topt == "2") |
194 if (strncmp (opt, "green", 5)) | 207 if (strncmp (opt, "green", 5)) |
195 n = 5; | 208 n = 5; |
196 endif | 209 endif |
197 options.color = [0, 1, 0]; | 210 options.color = [0, 1, 0]; |
198 elseif (topt == "b") | 211 elseif (topt == "b" || topt == "3") |
199 if (strncmp (opt, "black", 5)) | 212 if (strncmp (opt, "black", 5)) |
200 options.color = [0, 0, 0]; | 213 options.color = [0, 0, 0]; |
201 n = 5; | 214 n = 5; |
202 elseif (strncmp (opt, "blue", 4)) | 215 elseif (strncmp (opt, "blue", 4)) |
203 options.color = [0, 0, 1]; | 216 options.color = [0, 0, 1]; |
208 elseif (topt == "y") | 221 elseif (topt == "y") |
209 if (strncmp (opt, "yellow", 6)) | 222 if (strncmp (opt, "yellow", 6)) |
210 n = 6; | 223 n = 6; |
211 endif | 224 endif |
212 options.color = [1, 1, 0]; | 225 options.color = [1, 1, 0]; |
213 elseif (topt == "m") | 226 elseif (topt == "m" || topt == "4") |
214 if (strncmp (opt, "magenta", 7)) | 227 if (strncmp (opt, "magenta", 7)) |
215 n = 7; | 228 n = 7; |
216 endif | 229 endif |
217 options.color = [1, 0, 1]; | 230 options.color = [1, 0, 1]; |
218 elseif (topt == "c") | 231 elseif (topt == "c" || topt == "5") |
219 if (strncmp (opt, "cyan", 4)) | 232 if (strncmp (opt, "cyan", 4)) |
220 n = 4; | 233 n = 4; |
221 endif | 234 endif |
222 options.color = [0, 1, 1]; | 235 options.color = [0, 1, 1]; |
223 elseif (topt == "w") | 236 elseif (topt == "w" || topt == "6") |
224 if (strncmp (opt, "white", 5)) | 237 if (strncmp (opt, "white", 5)) |
225 n = 5; | 238 n = 5; |
226 endif | 239 endif |
227 options.color = [1, 1, 1]; | 240 options.color = [1, 1, 1]; |
228 elseif (isspace (topt)) | 241 elseif (isspace (topt)) |