Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

a surface plotting with inner and outer color different

Tags:

plot

matlab

I am going to plot a 3D surface in matlab. I use the surf function, but I want to recolor it in a way that the inner surface has one color and the outer has another one. How can I do that?

A = [12 18 12
     23 47 27
     32 11 36
     48 47 39
     28 50 28]
figure, surf(A)
like image 484
shaloo shaloo Avatar asked Feb 06 '26 23:02

shaloo shaloo


1 Answers

See if this helps,

 surf(A+.01,'FaceColor',[ 1  0  1]);
 hold on; 
 surf(A,'FaceColor',[ 0  0  1]);

gives,

enter image description here

enter image description here

I couldn't come up with better idea!

This is just a trick, maybe there is a way to color each side of a plane.

like image 104
Rashid Avatar answered Feb 09 '26 07:02

Rashid