Per-face colors in plot_trisurf
See original GitHub issueThe docs for pylab.plot_trisurf
state that triangles
is of shape (N,3) and that color
should also be of shape (N, 3), implying that the colors will apply to the triangle faces, not the vertices.
However, the observed behavior (on version 0.4.0a2 from PyPI) is to color the vertices.
colors = np.ones((4,3))*.3
colors[0, 2] = 1.0
colors[3, 2] = 1.0
plot_trisurf([0, 0, 3., 3.], [0, 4., 0, 4.], [1, 0., 0, 1.],
triangles=[[0, 2, 3], [0, 3, 1]], color=colors)

If the above behavior is as intended? If so, is there another way to set the triangle face color directly?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Tri-Surface Plot in Python using Matplotlib - GeeksforGeeks
cmap, color map to set the color of surface patches ... 1: Let's create a basic Tri-Surface plot using the ax.plot_trisurf() function.
Read more >Simple surface plots
Some of the different options for producing surface plots are illustrated by the code below. import numpy as np import matplotlib.pyplot ...
Read more >3D surface (colormap) — Matplotlib 3.6.2 documentation
Demonstrates plotting a 3D surface colored with the coolwarm colormap. The surface is made opaque by using antialiased=False .
Read more >3D Surface Plots - Problem Solving with Python
Surface plots are created with Matplotlib's ax.plot_surface() method. By default, surface plots are a single color. The general format of Matplotlib's ax.
Read more >How to plot a 3D Surface Triangulation Plot in Python?
Axes.plot_trisurf(*args, color=None, norm=None, vmin=None, vmax=None, ... X, Y, Z: Data values as 1D arrays. color: Color of the surface patches.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, I’ll keep this open and dive into it later, maybe it is possible more efficiently.
I think this can be done at the kernel side first, I guess
face_colors
andtriangle_colors
arguments to plot_* would need to sort out the duplication of vertices manually.