# HG changeset patch # User John Hunt # Date 1340146855 14400 # Node ID 566cf544d0206d0dd76da9a287cd74d3f07eb0dc # Parent e190f6da40f6939c7762252ac27a99361295dcad 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. diff -r e190f6da40f6 -r 566cf544d020 scripts/plot/private/__scatter__.m --- a/scripts/plot/private/__scatter__.m Tue Jun 19 10:05:01 2012 -0700 +++ b/scripts/plot/private/__scatter__.m Tue Jun 19 19:00:55 2012 -0400 @@ -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, diff -r e190f6da40f6 -r 566cf544d020 scripts/plot/scatter.m --- a/scripts/plot/scatter.m Tue Jun 19 10:05:01 2012 -0700 +++ b/scripts/plot/scatter.m Tue Jun 19 19:00:55 2012 -0400 @@ -92,6 +92,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)); %! title ('Scatter plot with bubble color determined by distance from origin');