anyway to color 2D triangular plot with "CData"

2 views (last 30 days)
Yu Li
Yu Li on 13 Dec 2020
Commented: KSSV on 14 Dec 2020
I have a 2D triangulation data including vertices and connectivity, I want to color it with the value at its geometry center. I tried to add a "CData" but it is not recognized by "triplot" function:
where DT is the triangulation objective, and cm is the color at each triangle center.
is there anyway in Matlab can do this?

Answers (1)

KSSV on 13 Dec 2020
Edited: KSSV on 13 Dec 2020
Read about trisurf. Also have a look on patch. You can use any of the two to achieve what you want.
KSSV on 14 Dec 2020
I am assuming that cm is a column array with same number of rows present in Dt.Points.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!