- plot3() to have each edge drawn as a distinct line
- patch() with duplicating a whole bunch of data so you have as many vertices as you wanted edges in the original mesh
How to plot a wireframe mesh setting different color per edge ?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Anna Shtengel
el 11 de Oct. de 2015
Comentada: Anna Shtengel
el 11 de Oct. de 2015
Hi, I'm trying to plot a mesh with a specific color per edge and no color for the faces. The problem with existing functions (that I know of) is that I can set the EdgeColor property to be the same for all edges, or interpolate the colors I set for the vertices on the edges ('interp '). Does anyone has an idea? Thanks!
0 comentarios
Respuesta aceptada
Walter Roberson
el 11 de Oct. de 2015
Not exactly. EdgeColor 'flat' gives you an additional option:
Draw uniform edge colors. Use the CData value of the first vertex of the face to determine the color for each edge
Unfortunately when you use mesh() you create a "Chart Surface Object" (newer releases) or a surface() (older releases), and you do not get any control over the order in which the vertices are used to determine the color of the face.
If you were to use patch() instead of mesh() you could create the Faces property explicitly, allowing you to determine which is the "first" vertex for the purpose of "flat" coloring. patch() and surface objects are quite similar in that regards, but patch() offers also FaceVertexCData as well as CData properties (and I am not sure at the moment why you would use one or the other.)
Either way, mesh() or surface() or patch(), you have the difficulty that there are more edges than vertices.
Where does this leave you?
Más respuestas (0)
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!