【发布时间】:2017-02-11 16:12:46
【问题描述】:
我正在尝试使用 trisurf 绘制船体。我需要指定每个三角形的颜色(有很多)。这可以做到吗?我试过了,但它不起作用:
import matplotlib.pyplot as plt:
...
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_trisurf(points[:,0], points[:,1], points[:,2],
triangles=faces, cmap=facecolors)
plt.show()
facecolors是一个带有len(faces)rows的矩阵;每行是(R,G,B)。如果我省略了cmapargument,它的绘图效果很好,但当然是单色的。
有没有可能做我想做的事?
【问题讨论】:
-
“但它不起作用”不足以描述问题。
标签: python-2.7 matplotlib