Mercurial > octave
comparison scripts/plot/private/__patch__.m @ 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 | 131d56b6d9a3 |
children | 4cb1522e4d0f |
comparison
equal
deleted
inserted
replaced
11186:f72e17e70378 | 11187:0a8e554494c9 |
---|---|
181 if (idx > nargs) | 181 if (idx > nargs) |
182 vert = []; | 182 vert = []; |
183 else | 183 else |
184 vert = args {idx}; | 184 vert = args {idx}; |
185 endif | 185 endif |
186 idx = find (cellfun (@(x) strcmpi (x, "facevertexcdata"), args))(end) + 1; | 186 idx = find (cellfun (@(x) strcmpi (x, "facevertexcdata"), args), 1, "last") + 1; |
187 if (isempty(idx) || idx > nargs) | 187 if (isempty(idx) || idx > nargs) |
188 fvc = []; | 188 fvc = []; |
189 else | 189 else |
190 fvc = args {idx}; | 190 fvc = args {idx}; |
191 endif | 191 endif |
192 idx = find (cellfun (@(x) strcmpi (x, "facecolor"), args))(end) + 1; | 192 idx = find (cellfun (@(x) strcmpi (x, "facecolor"), args), 1, "last") + 1; |
193 if (isempty(idx) || idx > nargs) | 193 if (isempty(idx) || idx > nargs) |
194 if (!isempty (fvc)) | 194 if (!isempty (fvc)) |
195 fc = "flat"; | 195 fc = "flat"; |
196 else | 196 else |
197 fc = [0, 1, 0]; | 197 fc = [0, 1, 0]; |
225 if (size(fvc, 2) == 3) | 225 if (size(fvc, 2) == 3) |
226 c = cat(3, reshape (fvc(idx, 1), size(idx)), | 226 c = cat(3, reshape (fvc(idx, 1), size(idx)), |
227 reshape (fvc(idx, 2), size(idx)), | 227 reshape (fvc(idx, 2), size(idx)), |
228 reshape (fvc(idx, 3), size(idx))); | 228 reshape (fvc(idx, 3), size(idx))); |
229 else | 229 else |
230 c = reshape (fvc(idx), size(idx)); | 230 c = []; |
231 endif | 231 endif |
232 endif | 232 endif |
233 args = {"xdata", x, "ydata", y, "zdata", z, "cdata", c, args{:}}; | 233 args = {"xdata", x, "ydata", y, "zdata", z, "cdata", c, args{:}}; |
234 endfunction | 234 endfunction |
235 | 235 |