[Python] How do I color 3d triangular mesh using another scalar in matplotlib?

Discussão em 'Python' iniciado por Stack, Maio 22, 2025.

  1. Stack

    Stack Membro Participativo

    I have 3d vertex position data (x,y,z), scalar values at each vertex v, and vertex indices for each triangle tri.

    If I were to draw the surface geometry itself, I could use plot_trisurf. If I were to draw a 2D projected plot with each triangle colored according to the vertex scalar, than I could use tripcolor with one of the coordinates omitted. However, it seems oddly unclear how I draw the 3D surface with each face colored according to the vertex scalar, not the z coordinate value.

    How do I do this? If it is not within matplotlib's ability, is there a python tool that can do this?

    Continue reading...

Compartilhe esta Página