How do I specify different colors for different faces of my patch on map axes, using "patchm" or "patchesm"? I want to create a patch object that has multiple faces, and I want to color the faces differently.
When I attempt to pass a vector of color values, which has the same length as the number of faces, as the "cdata" parameter to either "patchm" or "patchesm" I get the error "Color value must be a 3 element numeric vector". My code is as follows:
>> load coastlines>> axesm sinusoid;>> framem>> numOfFaces = 243;>> colormap(jet(numOfFaces))>> caxis([1 numOfFaces])>> zVal = 0;>> colorData = (1:numOfFaces)';>> h = patchm(coastlat, coastlon, zVal, colorData, 'FaceColor', 'flat');
Similarly, "patchesm" gives the same error if I pass a vector as the "cdata" parameter.
Best Answer