Hi, I want to set the face color of each triangle individually when plotting with
plot_trisurf in PyPlot. The matplotlib manual seems to indicate that face color is set with the option ‘color’ (as a tuple), but there is also an optional argument ‘facecolor’ that is passed to Poly3DCollection. However, I cannot figure out how to apply this so that each triangle (patch) gets a separately defined color. I do manage to set the edge colors separately using the argument ‘edgecolor’.
This produces the result when all triangles (only two here) get the same color:
using PyPlot fig = figure() ax = Axes3D(fig) x = [0., 1., 1., 0.] y = [0., 0.5, 1., 1.] z = [0., 0., 1., 0.2] t = [1 2 4; 2 3 4]-1 # Zero-based indexing required (?) fclr = [1. 0. 0.; 0. 0. 1.] c = (0.,1.,0.) plot_trisurf(x,y,z,triangles=t,color=c,edgecolor=fclr,alpha=0.8, linewidth=3.);
I have not managed to get any effect by setting the ‘facecolor’ argument and I don’t know the syntax for passing multiple colors to ‘color’.
Any pointers to where I can find documentation about this, i.e., plotting surfaces with individually defined triangles, without resorting to a loop “over the triangles”?
Tested with v. 0.5.2 and 0.6.0.