comparison scripts/plot/util/struct2hdl.m @ 19833:9fc020886ae9

maint: Clean up m-files to follow Octave coding conventions. Try to trim long lines to < 80 chars. Use '##' for single line comments. Use '(...)' around tests for if/elseif/switch/while. Abut cell indexing operator '{' next to variable. Abut array indexing operator '(' next to variable. Use space between negation operator '!' and following expression. Use two newlines between endfunction and start of %!test or %!demo code. Remove unnecessary parens grouping between short-circuit operators. Remove stray extra spaces (typos) between variables and assignment operators. Remove stray extra spaces from ends of lines.
author Rik <rik@octave.org>
date Mon, 23 Feb 2015 14:54:39 -0800
parents 4197fc428c7d
children
comparison
equal deleted inserted replaced
19832:a1acca0c2216 19833:9fc020886ae9
461 461
462 temp = ismember ([p(1:2:end) oldh], bargroup); 462 temp = ismember ([p(1:2:end) oldh], bargroup);
463 463
464 tst = sum (temp) == length (bargroup); 464 tst = sum (temp) == length (bargroup);
465 465
466 if (isscalar (bargroup) || !tst) 466 if (isscalar (bargroup) || ! tst)
467 xdata = s.properties.xdata; 467 xdata = s.properties.xdata;
468 ydata = s.properties.ydata; 468 ydata = s.properties.ydata;
469 469
470 h = bar (xdata, ydata); 470 h = bar (xdata, ydata);
471 471
482 ##build x/y matrix 482 ##build x/y matrix
483 nbar = length (bargroup); 483 nbar = length (bargroup);
484 tmp = struct ("handle", NaN, "type", "", "children", [], "special", []); 484 tmp = struct ("handle", NaN, "type", "", "children", [], "special", []);
485 for ii = 1:(nbar - 1) 485 for ii = 1:(nbar - 1)
486 idx = find (p(1:2:end) == bargroup(ii)) * 2; 486 idx = find (p(1:2:end) == bargroup(ii)) * 2;
487 hdl = p (idx); 487 hdl = p(idx);
488 xdata = [xdata get(hdl).xdata]; 488 xdata = [xdata get(hdl).xdata];
489 ydata = [ydata get(hdl).ydata]; 489 ydata = [ydata get(hdl).ydata];
490 tmp.children(ii) = hdl2struct (hdl); 490 tmp.children(ii) = hdl2struct (hdl);
491 endfor 491 endfor
492 492