Hi Lucas,
You are correct, this behavior is reproducible and can be explained as follows: The 'Facecolor' property of surf (patch object) can be set to 'none', 'flat' and 'interp': link to the documentation. The default value of the 'FaceColor' is 'flat' which uses uniform face colors. The color data at the first vertex determines the color for the entire face (and hence one quadrant was red since its first vertex had value '1'). You cannot use this value when the 'FaceAlpha' property is set to 'interp. Find below the same surf plot with 'FaceColor' property being set to 'interp': >> s = surf(x,y,z);
>> set(s,'FaceColor', 'interp');
Now if we rotate the plot appropriately we can see that each quadrant is made up of two triangles (since all the 4 points that make up the patch are not co-planar, so the patch needs to be drawn as two triangles). You can also notice how the triangles are arranged/joined differently in the lower left and lower right quadrants (the demarcation is shown by red and green lines respectively):
>> l1 = line([0 1],[-1 0],[0 0],'Color','green');
>> l2 = line([-1 -0],[-1 0],[0 1],'Color','red');
The order and the way in which the triangles are created is decided by the 'surf' command. We can explicitly define the order of the faces/triangles, for example in the following way (though it would be a little tedious):
>> [X,Y] = meshgrid(-1:1,-1:1);
>> Z = [0 0 0; 0 1 0; 0 0 0];
>> V = [X(:) Y(:) Z(:)];
>> F = [2 5 3; 3 5 6; 6 5 9; 9 5 8; 8 5 7; 7 5 4; 4 5 1; 1 5 2];
>> p = patch('Faces',F,'Vertices',V);
>> set(p,'FaceVertexCData',Z(:));
>> set(p,'FaceColor','interp');
I believe this generates the figure you were expecting in your problem.