diff scripts/plot/private/__patch__.m @ 14108:5be545210fe3 stable

Trisurf() improvements. * __go_draw_axes__.m: Revert changeset 595ee644fa6f. Properly identify RGB cdata [1x3] for patches. * trisurf.m: Correct bugs in converting between facevertexcdata and cdata. This allows caxis auto to function correctly, and properly fixes bug 35144. Add demos to explicitly test facecolor = "flat" and "interp".
author Ben Abbott <bpabbott@mac.com>
date Sun, 25 Dec 2011 12:18:49 -0500
parents 2ebbc6c9961b
children 9627d5134a12
line wrap: on
line diff
--- a/scripts/plot/private/__patch__.m
+++ b/scripts/plot/private/__patch__.m
@@ -274,8 +274,10 @@
       c = cat(3, reshape (fvc(idx, 1), size(idx)),
               reshape (fvc(idx, 2), size(idx)),
               reshape (fvc(idx, 3), size(idx)));
-    else
-      c = [];
+    elseif (isempty (fvc))
+      c = []
+    else ## if (size (fvc, 2) == 1)
+      c = permute (fvc(faces), [2, 1]);
     endif
   endif
   args = {"xdata", x, "ydata", y, "zdata", z, "cdata", c, args{:}};
@@ -335,10 +337,8 @@
 
   if (ndims (c) == 3)
     fvc = reshape (c, size (c, 1) * size (c, 2), size(c, 3));
-  elseif (isvector (c))
+  else
     fvc = c(:);
-  else
-    fvc = c.'(:);
   endif
 
   args = {"faces", faces, "vertices", vert, "facevertexcdata", fvc, args{:}};