Creating Matlab plot with multiple mesh models, only one with CDATA

Hi Everyone,
I am looking for a way to plot three mesh models using trisurf but I want one of the mesh models to be colored using CData, but the other two to be a single color using FaceColor. Is there a simple way to do this?
-Katherine
EDIT:
My data is in face vertex format and plotting is done using trisurf.

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 4 月 9 日

0 投票

surf(x1, y1, z1, c1);
hold on
surf(x2, y2, z2, c2);
surf(x3, y3, z3, 'facecolor', 'g')
hold off

4 件のコメント

Katherine Beaulieu
Katherine Beaulieu 2020 年 4 月 9 日
Hi Walter,
My data is in face, vertex format this wouldn't work. Thank you for the response though - I will edit my original post to include the necessary info!
-Katherine
Walter Roberson
Walter Roberson 2020 年 4 月 9 日
trisurf(tr1, x1, y1, z1, c1);
hold on
trisurf(tr2, x2, y2, z2, c2);
trisurf(tr3, x3, y3, z3, 'facecolor', 'g')
hold off
Hi Walter,
This is the code I am using:
figure;
trisurf(skull_f,skull_v(:,1),skull_v(:,2),skull_v(:,3),gradient_color)
hold on
trisurf(cs_tri,'facecolor','w')
hold on
trisurf(mid_tri,'facecolor','k');
But I still am only getting one color for the skull mesh. My color data is a 5000x1 vector, the same size as x,y, and z.
Walter Roberson
Walter Roberson 2020 年 4 月 9 日
You need to pass the x, y, z coordinates for the second and third trisurf(). It will not inherit them from the first call.

サインインしてコメントする。

カテゴリ

タグ

質問済み:

2020 年 4 月 9 日

コメント済み:

2020 年 4 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by