function h = biline (x, y, col) newplot (); if (nargin < 3) col = 'r'; endif tmp = hggroup; addproperty ("color", tmp, "color", col); addproperty ("marker", tmp, "linemarker", "o"); addproperty ("barsize", tmp, "double", 0.05); addlistener (tmp, "color", @update_props); addlistener (tmp, "marker", @update_props); addlistener (tmp, "barsize", @update_bar); m = get (tmp, "barsize"); x = x(:)'; y = y(:)'; xx = [x; x; nan(size(x))]; xx = xx(:)'; yy = [y+m; y-m; nan(size(y))]; yy = yy(:)'; h1 = line (x, y, "color", col, "parent", tmp); h2 = line (xx, yy, "color", col, "linestyle", "-", "marker", "o", "parent", tmp); if (nargout > 0) h = tmp; endif endfunction function update_props (h, d) kids = get (h, "children"); set (kids, "color", get (h, "color")); set (kids(2), "marker", get (h, "marker")); endfunction function update_bar (h, d) kids = get (h, "children"); y = get (kids(1), "ydata"); m = get (h, "barsize"); yy = [y+m; y-m; nan(size(y))]; yy = yy(:)'; set (kids(2), "ydata", yy); endfunction