Mercurial > hg > octave-lyh
changeset 17032:53d6166f7867
Fix bar() update for ydata listener.
scripts/plot/__bar__.m: patches should be children of the hggroup.
scripts/plot/bar.m: Modify demo to modify the "ydata" hggroup property.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 22 Jul 2013 02:51:41 +0200 |
parents | 38bcfd413db0 |
children | 02679492b0c6 |
files | scripts/plot/bar.m scripts/plot/private/__bar__.m |
diffstat | 2 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/bar.m +++ b/scripts/plot/bar.m @@ -98,8 +98,9 @@ %!demo %! clf; -%! y = rand (10, 1); -%! bar (y); +%! y = rand (11, 1); +%! h = bar (y); +%! set (h, 'ydata', sort (rand (11, 1))); %!demo %! clf;
--- a/scripts/plot/private/__bar__.m +++ b/scripts/plot/private/__bar__.m @@ -196,10 +196,10 @@ else lev = (i - 1) * (clim(2) - clim(1)) / (ycols - 1) - clim(1); endif - h = patch (xb(:,:,i), yb(:,:,i), "FaceColor", "flat", + h = patch (hg, xb(:,:,i), yb(:,:,i), "FaceColor", "flat", "cdata", lev, "parent", hg); else - h = patch (xb(:,:,i), yb(:,:,i), "parent", hg); + h = patch (hg, xb(:,:,i), yb(:,:,i), "parent", hg); endif else if (! have_color_spec) @@ -208,10 +208,10 @@ else lev = (i - 1) * (clim(2) - clim(1)) / (ycols - 1) - clim(1); endif - h = patch (yb(:,:,i), xb(:,:,i), "FaceColor", "flat", + h = patch (hg, yb(:,:,i), xb(:,:,i), "FaceColor", "flat", "cdata", lev, "parent", hg); else - h = patch (yb(:,:,i), xb(:,:,i), "parent", hg); + h = patch (hg, yb(:,:,i), xb(:,:,i), "parent", hg); endif endif