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

Untabify .m scripts
author Rik <code@nomad.inbox5.com>
date Fri, 23 Apr 2010 11:28:50 -0700
parents 4516a0c97ced
children 988d2bd6bacd
comparison
equal deleted inserted replaced
10548:479536c5bb10 10549:95c3e38098bf
45 h = []; 45 h = [];
46 46
47 nx = rows (x); 47 nx = rows (x);
48 for i = 1: columns (x) 48 for i = 1: columns (x)
49 if (have_z) 49 if (have_z)
50 xt = x(:)'; 50 xt = x(:)';
51 xt = [xt; xt; NaN(1, nx)](:); 51 xt = [xt; xt; NaN(1, nx)](:);
52 yt = y(:)'; 52 yt = y(:)';
53 yt = [yt; yt; NaN(1, nx)](:); 53 yt = [yt; yt; NaN(1, nx)](:);
54 zt = z(:)'; 54 zt = z(:)';
55 zt = [zeros(1, nx); zt; NaN(1, nx)](:); 55 zt = [zeros(1, nx); zt; NaN(1, nx)](:);
56 else 56 else
57 xt = x(:, i)'; 57 xt = x(:, i)';
58 xt = [xt; xt; NaN(1, nx)](:); 58 xt = [xt; xt; NaN(1, nx)](:);
59 yt = y(:, i)'; 59 yt = y(:, i)';
60 yt = [zeros(1, nx); yt; NaN(1, nx)](:); 60 yt = [zeros(1, nx); yt; NaN(1, nx)](:);
61 endif 61 endif
62 62
63 hg = hggroup (); 63 hg = hggroup ();
64 h = [h; hg]; 64 h = [h; hg];
65 args = __add_datasource__ (caller, hg, {"x", "y", "z"}, varargin{:}); 65 args = __add_datasource__ (caller, hg, {"x", "y", "z"}, varargin{:});
66 66
67 if (i == 1) 67 if (i == 1)
68 set (ax, "nextplot", "add"); 68 set (ax, "nextplot", "add");
69 endif 69 endif
70 70
71 if (isempty (llc)) 71 if (isempty (llc))
72 lc = __next_line_color__ (); 72 lc = __next_line_color__ ();
73 else 73 else
74 lc = llc; 74 lc = llc;
75 endif 75 endif
76 76
77 if (isempty (mmc)) 77 if (isempty (mmc))
78 mc = lc; 78 mc = lc;
79 else 79 else
80 mc = mmc; 80 mc = mmc;
81 endif 81 endif
82 82
83 if (dofill) 83 if (dofill)
84 fc = mc; 84 fc = mc;
85 else 85 else
86 fc = "none"; 86 fc = "none";
87 endif 87 endif
88 88
89 if (have_z) 89 if (have_z)
90 h_stems = plot3 (xt, yt, zt, "color", lc, "linestyle", ls, 90 h_stems = plot3 (xt, yt, zt, "color", lc, "linestyle", ls,
91 "parent", hg, x, y, z, "color", mc, 91 "parent", hg, x, y, z, "color", mc,
92 "marker", ms, "linestyle", "none", 92 "marker", ms, "linestyle", "none",
93 "markerfacecolor", fc, "parent", hg); 93 "markerfacecolor", fc, "parent", hg);
94 94
95 h_baseline = []; 95 h_baseline = [];
96 else 96 else
97 h_stems = plot (xt, yt, "color", lc, "linestyle", ls, 97 h_stems = plot (xt, yt, "color", lc, "linestyle", ls,
98 "parent", hg, x(:,i), y(:, i), "color", mc, "marker", 98 "parent", hg, x(:,i), y(:, i), "color", mc, "marker",
99 ms, "linestyle", "none", "markerfacecolor", 99 ms, "linestyle", "none", "markerfacecolor",
100 fc, "parent", hg); 100 fc, "parent", hg);
101 101
102 if (i == 1) 102 if (i == 1)
103 x_axis_range = get (ax, "xlim"); 103 x_axis_range = get (ax, "xlim");
104 h_baseline = line (x_axis_range, [0, 0], "color", [0, 0, 0]); 104 h_baseline = line (x_axis_range, [0, 0], "color", [0, 0, 0]);
105 set (h_baseline, "handlevisibility", "off"); 105 set (h_baseline, "handlevisibility", "off");
106 set (h_baseline, "xliminclude", "off"); 106 set (h_baseline, "xliminclude", "off");
107 addlistener (ax, "xlim", @update_xlim); 107 addlistener (ax, "xlim", @update_xlim);
108 addlistener (h_baseline, "ydata", @update_baseline); 108 addlistener (h_baseline, "ydata", @update_baseline);
109 addlistener (h_baseline, "visible", @update_baseline); 109 addlistener (h_baseline, "visible", @update_baseline);
110 endif 110 endif
111 endif 111 endif
112 112
113 ## Setup the hggroup and listeners. 113 ## Setup the hggroup and listeners.
114 addproperty ("showbaseline", hg, "radio", "{on}|off"); 114 addproperty ("showbaseline", hg, "radio", "{on}|off");
115 addproperty ("basevalue", hg, "data", 0); 115 addproperty ("basevalue", hg, "data", 0);
116 addproperty ("baseline", hg, "data", h_baseline); 116 addproperty ("baseline", hg, "data", h_baseline);
117 117
118 if (!have_z) 118 if (!have_z)
119 addlistener (hg, "showbaseline", @show_baseline); 119 addlistener (hg, "showbaseline", @show_baseline);
120 addlistener (hg, "basevalue", @move_baseline); 120 addlistener (hg, "basevalue", @move_baseline);
121 endif 121 endif
122 122
123 addproperty ("color", hg, "linecolor", lc); 123 addproperty ("color", hg, "linecolor", lc);
124 addproperty ("linewidth", hg, "linelinewidth", 0.5); 124 addproperty ("linewidth", hg, "linelinewidth", 0.5);
125 addproperty ("linestyle", hg, "linelinestyle", ls); 125 addproperty ("linestyle", hg, "linelinestyle", ls);
135 addlistener (hg, "markersize", @update_props); 135 addlistener (hg, "markersize", @update_props);
136 136
137 addproperty ("xdata", hg, "data", x(:, i)); 137 addproperty ("xdata", hg, "data", x(:, i));
138 addproperty ("ydata", hg, "data", y(:, i)); 138 addproperty ("ydata", hg, "data", y(:, i));
139 if (have_z) 139 if (have_z)
140 addproperty ("zdata", hg, "data", z(:, i)); 140 addproperty ("zdata", hg, "data", z(:, i));
141 else 141 else
142 addproperty ("zdata", hg, "data", []); 142 addproperty ("zdata", hg, "data", []);
143 endif 143 endif
144 144
145 addlistener (hg, "xdata", @update_data); 145 addlistener (hg, "xdata", @update_data);
146 addlistener (hg, "ydata", @update_data); 146 addlistener (hg, "ydata", @update_data);
147 addlistener (hg, "zdata", @update_data); 147 addlistener (hg, "zdata", @update_data);
148 148
149 if (! isempty (args)) 149 if (! isempty (args))
150 set (hg, args{:}); 150 set (hg, args{:});
151 endif 151 endif
152 if (i == 1 && !isempty(h_baseline)) 152 if (i == 1 && !isempty(h_baseline))
153 set (h_baseline, "parent", get (hg, "parent")); 153 set (h_baseline, "parent", get (hg, "parent"));
154 endif 154 endif
155 endfor 155 endfor
156 156
157 unwind_protect_cleanup 157 unwind_protect_cleanup
158 set (ax, "nextplot", hold_state); 158 set (ax, "nextplot", hold_state);
176 ## Remove prop/val pairs from data to consider. 176 ## Remove prop/val pairs from data to consider.
177 i = 2; 177 i = 2;
178 newargs = {}; 178 newargs = {};
179 while (i < length (varargin)) 179 while (i < length (varargin))
180 if (ischar (varargin{i}) && !(strcmpi ("fill", varargin{i}) 180 if (ischar (varargin{i}) && !(strcmpi ("fill", varargin{i})
181 || strcmpi ("filled", varargin{i}))) 181 || strcmpi ("filled", varargin{i})))
182 newargs{end + 1} = varargin{i}; 182 newargs{end + 1} = varargin{i};
183 newargs{end + 1} = varargin{i + 1}; 183 newargs{end + 1} = varargin{i + 1};
184 nargin = nargin - 2; 184 nargin = nargin - 2;
185 varargin(i:i+1) = []; 185 varargin(i:i+1) = [];
186 else 186 else
202 x = 1:rows (z); 202 x = 1:rows (z);
203 y = 1:columns (z); 203 y = 1:columns (z);
204 else 204 else
205 y = varargin{1}; 205 y = varargin{1};
206 if (isvector (y)) 206 if (isvector (y))
207 x = 1:length (y); 207 x = 1:length (y);
208 elseif (ismatrix (y)) 208 elseif (ismatrix (y))
209 x = 1:rows (y); 209 x = 1:rows (y);
210 else 210 else
211 error ("stem: Y must be a matrix"); 211 error ("stem: Y must be a matrix");
212 endif # in each case, x & y will be defined 212 endif # in each case, x & y will be defined
213 endif 213 endif
214 elseif (nargin == 3) 214 elseif (nargin == 3)
215 ## Several possibilities 215 ## Several possibilities
216 ## 216 ##
218 ## 2. 'filled' 218 ## 2. 'filled'
219 ## 3. line spec 219 ## 3. line spec
220 if (ischar (varargin{2})) 220 if (ischar (varargin{2}))
221 ## Only 2. or 3. possible. 221 ## Only 2. or 3. possible.
222 if (strcmpi ("fill", varargin{2}) || strcmpi ("filled", varargin{2})) 222 if (strcmpi ("fill", varargin{2}) || strcmpi ("filled", varargin{2}))
223 dofill = 1; 223 dofill = 1;
224 else 224 else
225 ## Parse the linespec. 225 ## Parse the linespec.
226 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{2}); 226 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{2});
227 endif 227 endif
228 if (have_z) 228 if (have_z)
229 z = varargin{1}; 229 z = varargin{1};
230 x = 1:rows (z); 230 x = 1:rows (z);
231 y = 1:columns (z); 231 y = 1:columns (z);
232 else 232 else
233 y = varargin{1}; 233 y = varargin{1};
234 if (isvector (y)) 234 if (isvector (y))
235 x = 1:length (y); 235 x = 1:length (y);
236 elseif (ismatrix (y)) 236 elseif (ismatrix (y))
237 x = 1:rows (y); 237 x = 1:rows (y);
238 else 238 else
239 error ("stem: Y must be a matrix"); 239 error ("stem: Y must be a matrix");
240 endif # in each case, x & y will be defined 240 endif # in each case, x & y will be defined
241 endif 241 endif
242 else 242 else
243 if (have_z) 243 if (have_z)
244 error ("stem3: must define X, Y and Z"); 244 error ("stem3: must define X, Y and Z");
245 else 245 else
246 ## Must be the real y data. 246 ## Must be the real y data.
247 x = varargin{1}; 247 x = varargin{1};
248 y = varargin{2}; 248 y = varargin{2};
249 if (! (ismatrix (x) && ismatrix (y))) 249 if (! (ismatrix (x) && ismatrix (y)))
250 error ("stem: X and Y must be matrices"); 250 error ("stem: X and Y must be matrices");
251 endif 251 endif
252 endif 252 endif
253 endif 253 endif
254 elseif (nargin == 4) 254 elseif (nargin == 4)
255 ## Again, several possibilities: 255 ## Again, several possibilities:
256 ## 256 ##
259 ## arg3 1. real z 259 ## arg3 1. real z
260 ## arg3 2. 'filled' or linespec 260 ## arg3 2. 'filled' or linespec
261 if (ischar (varargin{2})) 261 if (ischar (varargin{2}))
262 ## Only arg2 2. / arg3 1. & arg3 3. are possible. 262 ## Only arg2 2. / arg3 1. & arg3 3. are possible.
263 if (strcmpi ("fill", varargin{2}) || strcmpi ("filled", varargin{2})) 263 if (strcmpi ("fill", varargin{2}) || strcmpi ("filled", varargin{2}))
264 dofill = 1; 264 dofill = 1;
265 fill_2 = 1; # Be sure, no second "fill" is in the arguments. 265 fill_2 = 1; # Be sure, no second "fill" is in the arguments.
266 else 266 else
267 ## Must be a linespec. 267 ## Must be a linespec.
268 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{2}); 268 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{2});
269 linespec_2 = 1; 269 linespec_2 = 1;
270 endif 270 endif
271 if (have_z) 271 if (have_z)
272 z = varargin{1}; 272 z = varargin{1};
273 x = 1:rows (z); 273 x = 1:rows (z);
274 y = 1:columns (z); 274 y = 1:columns (z);
275 else 275 else
276 y = varargin{1}; 276 y = varargin{1};
277 if (isvector (y)) 277 if (isvector (y))
278 x = 1:length (y); 278 x = 1:length (y);
279 elseif (ismatrix (y)) 279 elseif (ismatrix (y))
280 x = 1:rows (y); 280 x = 1:rows (y);
281 else 281 else
282 error ("stem: Y must be a matrix"); 282 error ("stem: Y must be a matrix");
283 endif # in each case, x & y will be defined 283 endif # in each case, x & y will be defined
284 endif 284 endif
285 else 285 else
286 if (have_z) 286 if (have_z)
287 x = varargin{1}; 287 x = varargin{1};
288 y = varargin{2}; 288 y = varargin{2};
289 z = varargin{3}; 289 z = varargin{3};
290 if (! (ismatrix (x) && ismatrix (y) && ismatrix (z))) 290 if (! (ismatrix (x) && ismatrix (y) && ismatrix (z)))
291 error ("stem3: X, Y and Z must be matrices"); 291 error ("stem3: X, Y and Z must be matrices");
292 endif 292 endif
293 else 293 else
294 ## must be the real y data. 294 ## must be the real y data.
295 x = varargin{1}; 295 x = varargin{1};
296 y = varargin{2}; 296 y = varargin{2};
297 if (! (ismatrix (x) && ismatrix (y))) 297 if (! (ismatrix (x) && ismatrix (y)))
298 error ("stem: X and Y must be matrices"); 298 error ("stem: X and Y must be matrices");
299 endif 299 endif
300 endif 300 endif
301 endif # if ischar(varargin{2}) 301 endif # if ischar(varargin{2})
302 if (! have_z) 302 if (! have_z)
303 ## varargin{3} must be char. 303 ## varargin{3} must be char.
304 ## Check for "fill. 304 ## Check for "fill.
305 if ((strcmpi (varargin{3}, "fill") || strcmpi (varargin{3}, "filled")) 305 if ((strcmpi (varargin{3}, "fill") || strcmpi (varargin{3}, "filled"))
306 && fill_2) 306 && fill_2)
307 error ("stem: duplicate fill argument"); 307 error ("stem: duplicate fill argument");
308 elseif (strcmpi ("fill", varargin{3}) && linespec_2) 308 elseif (strcmpi ("fill", varargin{3}) && linespec_2)
309 ## Must be "fill". 309 ## Must be "fill".
310 dofill = 1; 310 dofill = 1;
311 fill_2 = 1; 311 fill_2 = 1;
312 elseif ((strcmpi (varargin{3}, "fill") || strcmpi (varargin{3}, "filled")) 312 elseif ((strcmpi (varargin{3}, "fill") || strcmpi (varargin{3}, "filled"))
313 && !linespec_2) 313 && !linespec_2)
314 ## Must be "fill". 314 ## Must be "fill".
315 dofill = 1; 315 dofill = 1;
316 fill_2 = 1; 316 fill_2 = 1;
317 elseif (! linespec_2) 317 elseif (! linespec_2)
318 ## Must be linespec. 318 ## Must be linespec.
319 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{3}); 319 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{3});
320 linespec_2 = 1; 320 linespec_2 = 1;
321 endif 321 endif
322 endif 322 endif
323 elseif (nargin == 5) 323 elseif (nargin == 5)
324 if (have_z) 324 if (have_z)
325 x = varargin{1}; 325 x = varargin{1};
326 y = varargin{2}; 326 y = varargin{2};
327 z = varargin{3}; 327 z = varargin{3};
328 if (! (ismatrix (x) && ismatrix (y) && ismatrix (z))) 328 if (! (ismatrix (x) && ismatrix (y) && ismatrix (z)))
329 error ("stem3: X, Y and Z must be matrices"); 329 error ("stem3: X, Y and Z must be matrices");
330 endif 330 endif
331 else 331 else
332 x = varargin{1}; 332 x = varargin{1};
333 y = varargin{2}; 333 y = varargin{2};
334 if (! (ismatrix (x) && ismatrix (y))) 334 if (! (ismatrix (x) && ismatrix (y)))
335 error ("stem: X and Y must be matrices"); 335 error ("stem: X and Y must be matrices");
336 endif 336 endif
337 endif 337 endif
338 338
339 if (! have_z) 339 if (! have_z)
340 if (strcmpi (varargin{3}, "fill") || strcmpi (varargin{3}, "filled")) 340 if (strcmpi (varargin{3}, "fill") || strcmpi (varargin{3}, "filled"))
341 dofill = 1; 341 dofill = 1;
342 fill_2 = 1; # Be sure, no second "fill" is in the arguments. 342 fill_2 = 1; # Be sure, no second "fill" is in the arguments.
343 else 343 else
344 ## Must be a linespec. 344 ## Must be a linespec.
345 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{3}); 345 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{3});
346 linespec_2 = 1; 346 linespec_2 = 1;
347 endif 347 endif
348 endif 348 endif
349 349
350 ## Check for "fill". 350 ## Check for "fill".
351 if ((strcmpi (varargin{4}, "fill") || strcmpi (varargin{4}, "filled")) 351 if ((strcmpi (varargin{4}, "fill") || strcmpi (varargin{4}, "filled"))
352 && fill_2) 352 && fill_2)
353 error ("%s: duplicate fill argument", caller); 353 error ("%s: duplicate fill argument", caller);
354 elseif ((strcmpi (varargin{4}, "fill") || strcmpi (varargin{4}, "filled")) 354 elseif ((strcmpi (varargin{4}, "fill") || strcmpi (varargin{4}, "filled"))
355 && linespec_2) 355 && linespec_2)
356 ## Must be "fill". 356 ## Must be "fill".
357 dofill = 1; 357 dofill = 1;
358 fill_2 = 1; 358 fill_2 = 1;
359 elseif (!strcmpi (varargin{4}, "fill") && !strcmpi (varargin{4}, "filled") 359 elseif (!strcmpi (varargin{4}, "fill") && !strcmpi (varargin{4}, "filled")
360 && !linespec_2) 360 && !linespec_2)
361 ## Must be linespec. 361 ## Must be linespec.
362 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{4}); 362 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{4});
363 linespec_2 = 1; 363 linespec_2 = 1;
364 endif 364 endif
365 elseif (nargin == 6 && have_z) 365 elseif (nargin == 6 && have_z)
379 linespec_2 = 1; 379 linespec_2 = 1;
380 endif 380 endif
381 381
382 ## check for "fill" .. 382 ## check for "fill" ..
383 if ((strcmpi (varargin{5}, "fill") || strcmpi (varargin{5}, "filled")) 383 if ((strcmpi (varargin{5}, "fill") || strcmpi (varargin{5}, "filled"))
384 && fill_2) 384 && fill_2)
385 error ("stem3: duplicate fill argument"); 385 error ("stem3: duplicate fill argument");
386 elseif ((strcmpi (varargin{5}, "fill") || strcmpi (varargin{5}, "filled")) 386 elseif ((strcmpi (varargin{5}, "fill") || strcmpi (varargin{5}, "filled"))
387 && linespec_2) 387 && linespec_2)
388 ## Must be "fill". 388 ## Must be "fill".
389 dofill = 1; 389 dofill = 1;
390 fill_2 = 1; 390 fill_2 = 1;
391 elseif (!strcmpi (varargin{5}, "fill") && !strcmpi (varargin{5}, "filled") 391 elseif (!strcmpi (varargin{5}, "fill") && !strcmpi (varargin{5}, "filled")
392 && !linespec_2) 392 && !linespec_2)
393 ## Must be linespec. 393 ## Must be linespec.
394 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{5}); 394 [lc, ls, mc, ms] = stem_line_spec (caller, varargin{5});
395 linespec_2 = 1; 395 linespec_2 = 1;
396 endif 396 endif
397 else 397 else
409 endif 409 endif
410 else 410 else
411 if (isvector (x)) 411 if (isvector (x))
412 x = x(:); 412 x = x(:);
413 if (isvector (y)) 413 if (isvector (y))
414 if (length (x) != length (y)) 414 if (length (x) != length (y))
415 error ("stem: inconsistent size of x and y"); 415 error ("stem: inconsistent size of x and y");
416 else 416 else
417 y = y(:); 417 y = y(:);
418 endif 418 endif
419 else 419 else
420 if (length (x) == rows (y)) 420 if (length (x) == rows (y))
421 x = repmat (x(:), 1, columns (y)); 421 x = repmat (x(:), 1, columns (y));
422 else 422 else
423 error ("stem: inconsistent size of x and y"); 423 error ("stem: inconsistent size of x and y");
424 endif 424 endif
425 endif 425 endif
426 elseif (!size_equal (x, y)) 426 elseif (!size_equal (x, y))
427 error ("stem: inconsistent size of x and y"); 427 error ("stem: inconsistent size of x and y");
428 endif 428 endif
429 endif 429 endif
431 endfunction 431 endfunction
432 432
433 function [lc, ls, mc, ms] = stem_line_spec (caller, str) 433 function [lc, ls, mc, ms] = stem_line_spec (caller, str)
434 if (! ischar (str)) 434 if (! ischar (str))
435 error ("%s: expecting argument to be \"fill\" or a string of specifiers", 435 error ("%s: expecting argument to be \"fill\" or a string of specifiers",
436 caller); 436 caller);
437 endif 437 endif
438 [lc, ls, mc, ms] = set_default_values (); 438 [lc, ls, mc, ms] = set_default_values ();
439 ## Parse the line specifier string. 439 ## Parse the line specifier string.
440 cur_props = __pltopt__ ("stem", str, false); 440 cur_props = __pltopt__ ("stem", str, false);
441 for i = 1:length(cur_props) 441 for i = 1:length(cur_props)
469 469
470 for i = 1 : length (kids) 470 for i = 1 : length (kids)
471 obj = get (kids (i)); 471 obj = get (kids (i));
472 if (strcmp (obj.type, "hggroup") && isfield (obj, "baseline")) 472 if (strcmp (obj.type, "hggroup") && isfield (obj, "baseline"))
473 if (any (get (obj.baseline, "xdata") != xlim)) 473 if (any (get (obj.baseline, "xdata") != xlim))
474 set (obj.baseline, "xdata", xlim); 474 set (obj.baseline, "xdata", xlim);
475 endif 475 endif
476 endif 476 endif
477 endfor 477 endfor
478 endfunction 478 endfunction
479 479
483 483
484 kids = get (get (h, "parent"), "children"); 484 kids = get (get (h, "parent"), "children");
485 for i = 1 : length (kids) 485 for i = 1 : length (kids)
486 obj = get (kids (i)); 486 obj = get (kids (i));
487 if (strcmp (obj.type, "hggroup") && isfield (obj, "baseline") 487 if (strcmp (obj.type, "hggroup") && isfield (obj, "baseline")
488 && obj.baseline == h) 488 && obj.baseline == h)
489 ## Only alter if changed to avoid recursion of the listener functions 489 ## Only alter if changed to avoid recursion of the listener functions
490 if (! strcmpi (get (kids(i), "showbaseline"), visible)) 490 if (! strcmpi (get (kids(i), "showbaseline"), visible))
491 set (kids (i), "showbaseline", visible); 491 set (kids (i), "showbaseline", visible);
492 endif 492 endif
493 if (! strcmpi (get (kids(i), "basevalue"), visible)) 493 if (! strcmpi (get (kids(i), "basevalue"), visible))
494 set (kids (i), "basevalue", ydata); 494 set (kids (i), "basevalue", ydata);
495 endif 495 endif
496 endif 496 endif
497 endfor 497 endfor
498 endfunction 498 endfunction
499 499