changeset 27758:fc8668e1cb26

__scatter__.m: Use one single patch for large number of points (bug #40663).
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 17 Nov 2019 10:26:50 +0100
parents 1a8fd58af587
children 992e702ef0d7
files scripts/plot/draw/private/__scatter__.m
diffstat 1 files changed, 2 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/private/__scatter__.m	Sat Nov 30 22:49:26 2019 +0100
+++ b/scripts/plot/draw/private/__scatter__.m	Sun Nov 17 10:26:50 2019 +0100
@@ -245,32 +245,10 @@
 
   else
 
-    ## For larger numbers of points, we split the points by common color.
-
+    ## For larger numbers of points, we use one single object.
     vert = [x, y, z];
-    if (one_explicit_color)
-      render_size_color (hg, vert, s, c, marker, filled, true);
-    else
-      if (rows (c) == 1)
-        c = repmat (c, rows (x), 1);
-      endif
-      ## We want to group points by color.  So first get all the unique colors
-      [cc, ~, c_to_cc] = unique (c, "rows");
+    render_size_color (hg, vert, s, c, marker, filled, true);
 
-      for i = 1 : rows (cc)
-        ## Now for each possible unique color, get the logical index of
-        ## points that correspond to that color
-        idx = (i == c_to_cc);
-        if (isscalar (s))
-          render_size_color (hg, vert(idx, :), s, c(idx,:),
-                                 marker, filled, true);
-        else
-          render_size_color (hg, vert(idx, :), s(idx), c(idx,:),
-                                 marker, filled, true);
-        endif
-      endfor
-
-    endif
   endif
 
   if (! ischar (c) && rows (c) > 1)