我正在使用python并使用matplotlib创建3D图形,但是plot_trisurf
方法将三角形保持在图形的一个边上,这真的很烦人。我一直在寻找解决办法,但没有成功地解决这个问题。
代码如下:
variableToDisplay='U'
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
surf = ax.plot_trisurf(X,Y,Z,cmap=cm.jet, linewidth=0.1)
fig.colorbar(surf)
fig.tight_layout()
plt.show(block=False)
我终于想办法了。下面是代码和获得的图形:
在变量“isbad”中,4.88几乎是y列表的最大值,因此该边上的三角形将被避免
enter image description here
相关问题 更多 >
编程相关推荐