I can't change polygon faces's color

1 回表示 (過去 30 日間)
Andrea Gusmara
Andrea Gusmara 2020 年 4 月 28 日
回答済み: SaiDileep Kola 2020 年 5 月 8 日
surf=gca;
xlim(surf,[-15 +15]);
xlabel('x');
zlim(surf,[-15 +15]);
zlabel('z');
ylim(surf,[-15 +15]);
ylabel('y');
% [1,1,1;4,1,1;4,4,1;1,4,1; 1,1,4;4,1,4;4,4,4;1,4,4]
%vertices=input('inserire i vertici del ploigono \n' );
S.vertices=[1,1,1;4,1,1;4,4,1;1,4,1; 1,1,4;4,1,4;4,4,4;1,4,4];
S.faces=[1,2,3,4;1,2,6,5;3,2,6,7;4,3,7,8;4,1,5,8;5,6,7,8];
p=patch(S);
c = p.CData;
p.CDataMapping = 'scaled';
p.FaceVertexCData=[1 0 0; 0 1 0 ; 0 0 1 ; 0 1 1 ; 1 0 1 ; 1 1 0 ];
  2 件のコメント
darova
darova 2020 年 4 月 28 日
Try
p.facecolor = 'flat';
Andrea Gusmara
Andrea Gusmara 2020 年 4 月 28 日
thank you so much , now the faces changes .

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

採用された回答

SaiDileep Kola
SaiDileep Kola 2020 年 5 月 8 日
To explore further on this, follow the documentation provided here

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDisplay and Exploration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by