# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1323014479 18000 # Node ID 7ab497513c1a96cc9941f6f10764a4a708b306fc # Parent 2c0765c14e4feb97ed9c4b2ecae7b602df107ee8 Fix colour properties in scatter (bug #34936) * __scatter_.m (render_size_color): Don't flatten c into a vector. * scatter.m: Add another useful demo. diff --git a/scripts/plot/private/__scatter__.m b/scripts/plot/private/__scatter__.m --- a/scripts/plot/private/__scatter__.m +++ b/scripts/plot/private/__scatter__.m @@ -286,7 +286,7 @@ "marker", marker, "markersize", s, "markeredgecolor", "none", "markerfacecolor", "flat", - "cdata", c, "facevertexcdata", c(:), + "cdata", c, "facevertexcdata", c, "linestyle", "none"); else h = __go_patch__ (hg, "xdata", x, "ydata", y, "zdata", z, @@ -295,7 +295,7 @@ "marker", marker, "markersize", s, "markeredgecolor", "flat", "markerfacecolor", "none", - "cdata", c, "facevertexcdata", c(:), + "cdata", c, "facevertexcdata", c, "linestyle", "none"); endif endif diff --git a/scripts/plot/scatter.m b/scripts/plot/scatter.m --- a/scripts/plot/scatter.m +++ b/scripts/plot/scatter.m @@ -115,3 +115,10 @@ %! s = 10 - 10*log (x.^2 + y.^2); %! h = scatter (x, y, [], "r", "s"); +%!demo +%! n = 500; +%! x = rand(n,1); +%! y = rand(n,1); +%! idx = ceil(rand(n,1)*3); +%! colors = eye(3)(idx, :); +%! scatter(x,y,15, colors, "filled") \ No newline at end of file