comparison scripts/plot/private/__pltopt__.m @ 10549:95c3e38098bf

Untabify .m scripts
author Rik <code@nomad.inbox5.com>
date Fri, 23 Apr 2010 11:28:50 -0700
parents 4516a0c97ced
children 3eba2cc7cbda
comparison
equal deleted inserted replaced
10548:479536c5bb10 10549:95c3e38098bf
110 opt = cellstr (opt); 110 opt = cellstr (opt);
111 endif 111 endif
112 for i = nel:-1:1 112 for i = nel:-1:1
113 [options(i), valid] = __pltopt1__ (caller, opt{i}, err_on_invalid); 113 [options(i), valid] = __pltopt1__ (caller, opt{i}, err_on_invalid);
114 if (! err_on_invalid && ! valid) 114 if (! err_on_invalid && ! valid)
115 return; 115 return;
116 endif 116 endif
117 endfor 117 endfor
118 else 118 else
119 print_usage (); 119 print_usage ();
120 endif 120 endif
150 if (strncmp (opt, "#~>", 3)) 150 if (strncmp (opt, "#~>", 3))
151 n = 3; 151 n = 3;
152 elseif (strncmp (opt, "#~", 2) || strncmp (opt, "~>", 2)) 152 elseif (strncmp (opt, "#~", 2) || strncmp (opt, "~>", 2))
153 n = 2; 153 n = 2;
154 elseif (strncmp (opt, "~", 1) || strncmp (opt, ">", 1) 154 elseif (strncmp (opt, "~", 1) || strncmp (opt, ">", 1)
155 || strncmp (opt, "#", 1)) 155 || strncmp (opt, "#", 1))
156 n = 1; 156 n = 1;
157 endif 157 endif
158 options.linestyle = opt(1:n); 158 options.linestyle = opt(1:n);
159 opt(1:n) = []; 159 opt(1:n) = [];
160 have_linestyle = true; 160 have_linestyle = true;
167 n = 2; 167 n = 2;
168 else 168 else
169 topt = opt(1); 169 topt = opt(1);
170 n = 1; 170 n = 1;
171 if (topt == "-" || topt == ":") 171 if (topt == "-" || topt == ":")
172 have_linestyle = true; 172 have_linestyle = true;
173 options.linestyle = topt; 173 options.linestyle = topt;
174 elseif (topt == "+" || topt == "o" || topt == "*" 174 elseif (topt == "+" || topt == "o" || topt == "*"
175 || topt == "." || topt == "x" || topt == "s" 175 || topt == "." || topt == "x" || topt == "s"
176 || topt == "d" || topt == "^" || topt == "v" 176 || topt == "d" || topt == "^" || topt == "v"
177 || topt == ">" || topt == "<" || topt == "p" 177 || topt == ">" || topt == "<" || topt == "p"
178 || topt == "h" || topt == "@") 178 || topt == "h" || topt == "@")
179 have_marker = true; 179 have_marker = true;
180 ## Backward compatibility. Leave undocumented. 180 ## Backward compatibility. Leave undocumented.
181 if (topt == "@") 181 if (topt == "@")
182 topt = "+"; 182 topt = "+";
183 endif 183 endif
184 options.marker = topt; 184 options.marker = topt;
185 ### Numeric color specs for backward compatibility. Leave undocumented. 185 ### Numeric color specs for backward compatibility. Leave undocumented.
186 elseif (topt == "k" || topt == "0") 186 elseif (topt == "k" || topt == "0")
187 options.color = [0, 0, 0]; 187 options.color = [0, 0, 0];
188 elseif (topt == "r" || topt == "1") 188 elseif (topt == "r" || topt == "1")
189 options.color = [1, 0, 0]; 189 options.color = [1, 0, 0];
190 elseif (topt == "g" || topt == "2") 190 elseif (topt == "g" || topt == "2")
191 options.color = [0, 1, 0]; 191 options.color = [0, 1, 0];
192 elseif (topt == "b" || topt == "3") 192 elseif (topt == "b" || topt == "3")
193 options.color = [0, 0, 1]; 193 options.color = [0, 0, 1];
194 elseif (topt == "y") 194 elseif (topt == "y")
195 options.color = [1, 1, 0]; 195 options.color = [1, 1, 0];
196 elseif (topt == "m" || topt == "4") 196 elseif (topt == "m" || topt == "4")
197 options.color = [1, 0, 1]; 197 options.color = [1, 0, 1];
198 elseif (topt == "c" || topt == "5") 198 elseif (topt == "c" || topt == "5")
199 options.color = [0, 1, 1]; 199 options.color = [0, 1, 1];
200 elseif (topt == "w" || topt == "6") 200 elseif (topt == "w" || topt == "6")
201 options.color = [1, 1, 1]; 201 options.color = [1, 1, 1];
202 elseif (isspace (topt)) 202 elseif (isspace (topt))
203 ## Do nothing. 203 ## Do nothing.
204 elseif (topt == ";") 204 elseif (topt == ";")
205 t = index (opt(2:end), ";"); 205 t = index (opt(2:end), ";");
206 if (t) 206 if (t)
207 options.key = undo_string_escapes (opt(2:t)); 207 options.key = undo_string_escapes (opt(2:t));
208 n = t+1; 208 n = t+1;
209 else 209 else
210 if (err_on_invalid) 210 if (err_on_invalid)
211 error ("%s: unfinished key label", caller); 211 error ("%s: unfinished key label", caller);
212 else 212 else
213 valid = false; 213 valid = false;
214 options = __default_plot_options__ (); 214 options = __default_plot_options__ ();
215 return; 215 return;
216 endif 216 endif
217 endif 217 endif
218 else 218 else
219 if (err_on_invalid) 219 if (err_on_invalid)
220 error ("%s: unrecognized format character: `%s'", caller, topt); 220 error ("%s: unrecognized format character: `%s'", caller, topt);
221 else 221 else
222 valid = false; 222 valid = false;
223 options = __default_plot_options__ (); 223 options = __default_plot_options__ ();
224 return; 224 return;
225 endif 225 endif
226 endif 226 endif
227 endif 227 endif
228 opt(1:n) = []; 228 opt(1:n) = [];
229 endwhile 229 endwhile
230 230