Changing the colour of one face of a sphere
4 views (last 30 days)
Show older comments
I want to generate a grey sphere but I want to change the color of only one face. The following code generates a sphere with all of its faces shaded grey.
rm = 1000*10^3;
[x y z] = sphere(100);
surf(rm*x,rm*y,rm*z, 'FaceColor', [0.5 0.5 0.5]);
Suppose that I want a specific face to be shaded another color that is located at some specific coordinate on the sphere, how could I do so?
Thanks in advance
0 Comments
Answers (1)
Walter Roberson
on 12 Sep 2018
See https://www.mathworks.com/help/matlab/ref/matlab.graphics.primitive.surface-properties.html for information about FaceColor and CData
I suggest you see also warp()
0 Comments
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!