How can I change the color of tiles in a spherical graph?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
I need to change color of every tile, so the sphere is a heat map just like this image.
This is just image that we got from our teacher, but i have no clue how to make it.
댓글 수: 0
답변 (2개)
Adam Danz
2023년 3월 29일
편집: Adam Danz
2023년 3월 29일
sphere
axis equal
colorbar
If you want to change the colors, you can plot the sphere using surf(X,Y,Z,C) where C controls color of each face.
Use the [X,Y,Z] = sphere syntax to return the x,y,z coordinates and then use h=surf(X,Y,Z) to produce the same sphere and return the surface handle. You can also control color by updating properties of the surface object h.
댓글 수: 0
daniel mitchell
2023년 3월 29일
편집: daniel mitchell
2023년 3월 29일
In S1 you can see the properties.
You can use the Cdata propery to change the color of each tile for example.
[X,Y,Z] = sphere;
figure
s1 = surf(X,Y,Z)
colorbar;
axis equal
figure;
s2 = surf(X,Y,Z)
s2.CData = zeros(21,21,3);
s2.CData(12,3,:) = [1 0 0] % R G B
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!