Mercurial > hg > octave-lyh
changeset 10083:614ad9e7a17b
use patches again in scatter plots
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 11 Jan 2010 22:06:19 +0100 |
parents | 28af9aa6f9ed |
children | 81e88250bf42 |
files | scripts/ChangeLog scripts/plot/private/__scatter__.m |
diffstat | 2 files changed, 35 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-01-11 Jaroslav Hajek <highegg@gmail.com> + + * plot/private/__scatter__.m: Use patch objects instead of lines, + switch at 100 points. + 2010-01-11 Jaroslav Hajek <highegg@gmail.com> * plot/private/__scatter__.m: Fix typos.
--- a/scripts/plot/private/__scatter__.m +++ b/scripts/plot/private/__scatter__.m @@ -120,7 +120,7 @@ addlistener (hg, "cdata", @update_data); addlistener (hg, "sizedata", @update_data); - if (numel (x) <= 20) + if (numel (x) <= 100) ## For small number of points, we'll construct an object for each point. @@ -130,9 +130,10 @@ if (ischar (c)) for i = 1 : numel (x) - h = __go_line__ (hg, "xdata", x(i), "ydata", y(i), "zdata", z(i,:), - "color", c, "marker", marker, - "markersize", s(i), "linestyle", "none"); + h = __go_patch__ (hg, "xdata", x(i), "ydata", y(i), "zdata", z(i,:), + "faces", 1, "vertices", [x(i), y(i), z(i,:)], + "facecolor", "none", "edgecolor", c, "marker", marker, + "markersize", s(i), "linestyle", "none"); if (filled) set(h, "markerfacecolor", c); endif @@ -143,11 +144,14 @@ endif for i = 1 : numel (x) - h = __go_line__ (hg, "xdata", x(i), "ydata", y(i), "zdata", z(i,:), - "color", c(i,:), "marker", marker, - "markersize", s(i), "linestyle", "none"); + h = __go_patch__ (hg, "xdata", x(i), "ydata", y(i), "zdata", z(i,:), + "faces", 1, "vertices", [x(i), y(i), z(i,:)], + "facecolor", "none", "edgecolor", "flat", + "cdata", c(i,:), + "marker", marker, "markersize", s(i), + "linestyle", "none"); if (filled) - set(h, "markerfacecolor", c(i,:)); + set(h, "markerfacecolor", "flat"); endif endfor endif @@ -236,11 +240,24 @@ x = vert(:,1); y = vert(:,2); z = vert(:,3:end); - h = __go_line__ (hg, "xdata", x, "ydata", y, "zdata", z, - "color", c, "marker", marker, - "markersize", s, "linestyle", "none"); - if (filled) - set(h, "markerfacecolor", c); + if (ischar (c)) + h = __go_patch__ (hg, "xdata", x, "ydata", y, "zdata", z, + "faces", 1, "vertices", vert, + "facecolor", "none", "edgecolor", c, "marker", marker, + "markersize", s, "linestyle", "none"); + if (filled) + set(h, "markerfacecolor", c); + endif + else + h = __go_patch__ (hg, "xdata", x, "ydata", y, "zdata", z, + "faces", 1, "vertices", vert, + "facecolor", "none", "edgecolor", "flat", + "cdata", c, + "marker", marker, "markersize", s, + "linestyle", "none"); + if (filled) + set(h, "markerfacecolor", "flat"); + endif endif else ## FIXME: round the size to one decimal place. It's not quite right, though.