MATLAB: Two surfaces plot hard to distinguish

MATLABplot

I have two surface plots in a single plot. These surface plots are hard to distinguish.
1. How can I change colors of each surface plots?
2. Are there any general methods to make these two plots easier to distinguish?

Best Answer

The surface plots are color according to their height in Z-direction. It is not meaningful to use a colored patch in the legend at all, because this cannot be used to identify the surface object.
Do you want them to have different colors?
function main
A = 3.14e3;
AS = A * 1.03;
[B, C] = meshgrid(1:1000e9:30000e9, 1:10e6:200e6);
Z = Test(A, B, C);
figure
h1 = surf(B, C, Z, 'FaceColor', 'b');
hold on
ZS = Test(AS, B, C);
h2 = surf(B, C, ZS, 'FaceColor', 'r');
legend([h1, h2])
end
function a = Test(A,B,C)
a = A.*power(B,0.3).*power(C,0.7);
end
Now you have a red and a blue surface, while the latter is hidden slightly under the red on (you can use the small rotation tool icon in the figure toolbar to find it).
The scientific notation 1e9 is much more efficient and nicer than 1*power(10, 9).