Mercurial > hg > octave-lyh
changeset 15973:d31a39a0ac77 stable
Fix scatter() for filled markers using gnuplot.
* scripts/plot/scripts/__scatter__.m: Allow filled markers with using gnuplot
and when the color is specified as an RGB triplet. Bug # 36193. Add demo.
author | John Hunt <huntj@gmx.us> |
---|---|
date | Tue, 19 Jun 2012 19:00:55 -0400 |
parents | 7ad3eea8a3af |
children | 53a2fb7b2557 |
files | scripts/plot/private/__scatter__.m scripts/plot/scatter.m |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/private/__scatter__.m +++ b/scripts/plot/private/__scatter__.m @@ -268,7 +268,8 @@ ## Does gnuplot only support triangles with different vertex colors ? ## TODO - Verify gnuplot can only support one color. If RGB triplets ## can be assigned to each vertex, then fix __go_draw_axe__.m - gnuplot_hack = numel (x) > 1 && strcmp (toolkit, "gnuplot"); + gnuplot_hack = (numel (x) > 1 && size(c, 2) == 3 + && strcmp (toolkit, "gnuplot")); if (ischar (c) || ! isflat || gnuplot_hack) if (filled) h = __go_patch__ (hg, "xdata", x, "ydata", y, "zdata", z,
--- a/scripts/plot/scatter.m +++ b/scripts/plot/scatter.m @@ -91,6 +91,14 @@ %! clf %! x = randn (100, 1); %! y = randn (100, 1); +%! c = x .* y; +%! scatter (x, y, 20, c, "filled"); +%! title ('Scatter with colors'); + +%!demo +%! clf; +%! x = randn (100, 1); +%! y = randn (100, 1); %! scatter (x, y, [], sqrt (x.^2 + y.^2)); %!demo