How to color triplot faces?

11 views (last 30 days)
Manar Al Asad
Manar Al Asad on 26 Aug 2020
Answered: Cris LaPierre on 27 Aug 2020
I have a 3D DTM in the form of triangulation (has faces and vertices) where the vertices coordinates are in cartesian coordinates (X,Y,Z). I would like to plot the DTM colored based on the radial position of each point.
In 3D this looks like the following, where r1 is a structure that has 2 fields: facets which a connectivity list, and vertices which is the point coordinates:
llr1(:,1),llr1(:,2),llr1(:,3)] = cart2sph(r1.vertices(:,1),...
r1.vertices(:,2),r1.vertices(:,3)); % convert to spherical coordinates to get radial position
llr1(:,1) = rad2deg(llr1(:,1)); % convert to degrees
llr1(:,2) = rad2deg(llr1(:,2)); % convert to degrees
Now I would like to do the same thing in 2D simple cylindrical projection
gives me a line map with the right connectivity
but now I would like to color the faces in the 2d plot. Has anyone encountered this problem before and has a simple solution to it?

Answers (1)

Cris LaPierre
Cris LaPierre on 27 Aug 2020
I believe a triplot is a line plot. You can color the lines and markers (vertices), but there are no faces to color.




Community Treasure Hunt

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

Start Hunting!