Two surfaces plot hard to distinguish

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?

2 Comments

The question is not clear. Share your code, so that it can be understood.
A=3.14*power(10,3);
AS=A*1.03;
[B,C] = meshgrid(1:1000*power(10,9):30000*power(10,9),1:10*power(10,6):200*power(10,6));
Z = Test(A,B,C);
figure
surf(B,C,Z);
hold on
ZS = Test(AS,B,C);
surf(B,C,ZS);
function a = Test(A,B,C)
a = A.*power(B,0.3).*power(C,0.7);
end

Sign in to comment.

 Accepted 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).

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Tags

Asked:

on 13 May 2018

Answered:

Jan
on 13 May 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!