changeset 11187:0a8e554494c9

__patch__.m: Don't index an empty array; bug introduced by changeset 11175.
author Ben Abbott <bpabbott@mac.com>
date Wed, 03 Nov 2010 18:02:03 +0800
parents f72e17e70378
children 4cb1522e4d0f
files scripts/ChangeLog scripts/plot/private/__patch__.m
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Nov 03 21:51:37 2010 +0800
+++ b/scripts/ChangeLog	Wed Nov 03 18:02:03 2010 +0800
@@ -15,6 +15,11 @@
 
 2010-11-03  Ben Abbott <bpabbott@mac.com>
 
+	* plot/private/__patch__.m: Don't index an empty array; bug introduced
+	by changeset 11175.
+
+2010-11-03  Ben Abbott <bpabbott@mac.com>
+
 	* miscellaneous/getappdata.m, miscellaneous/isappdata.m,
 	miscellaneous/rmappdata.m, miscellaneous/setappdata.m:
 	Add new appdata function.
--- a/scripts/plot/private/__patch__.m	Wed Nov 03 21:51:37 2010 +0800
+++ b/scripts/plot/private/__patch__.m	Wed Nov 03 18:02:03 2010 +0800
@@ -183,13 +183,13 @@
   else
     vert = args {idx};
   endif
-  idx = find (cellfun (@(x) strcmpi (x, "facevertexcdata"), args))(end) + 1;
+  idx = find (cellfun (@(x) strcmpi (x, "facevertexcdata"), args), 1, "last") + 1;
   if (isempty(idx) || idx > nargs)
     fvc = [];
   else
     fvc = args {idx};
   endif
-  idx = find (cellfun (@(x) strcmpi (x, "facecolor"), args))(end) + 1;
+  idx = find (cellfun (@(x) strcmpi (x, "facecolor"), args), 1, "last") + 1;
   if (isempty(idx) || idx > nargs)
     if (!isempty (fvc))
       fc = "flat";
@@ -227,7 +227,7 @@
               reshape (fvc(idx, 2), size(idx)),
               reshape (fvc(idx, 3), size(idx)));
     else
-      c = reshape (fvc(idx), size(idx));
+      c = [];
     endif
   endif
   args = {"xdata", x, "ydata", y, "zdata", z, "cdata", c, args{:}};