我正在尝试绘制一个3D表面,以适应python中的某些{x,y,z}点 - 理想情况下就像Mathematica ListSurfacePlot3D函数.到目前为止,我已经尝试plot_surface并且plot_wireframe在我的观点上无济于事.
只有轴渲染plot_surface.plot_wireframe给出了一堆波浪状的,隐约在对象的形状,但不是文档中显示的漂亮的排序:
与以下结果比较ListSurfacePlot3D:

这是一个最小的工作示例,使用我在这里发布的test.csv文件:
import csv
from matplotlib import pyplot
import pylab
from mpl_toolkits.mplot3d import Axes3D
hFile = open("test.csv", 'r')
datfile = csv.reader(hFile)
dat = []
for row in datfile:
dat.append(map(float,row))
temp = zip(*(dat))
fig = pylab.figure(figsize=pyplot.figaspect(.96))
ax = Axes3D(fig)
Run Code Online (Sandbox Code Playgroud)
然后,要么
ax.plot_surface(temp[0], temp[1], temp[2])
pyplot.show()
Run Code Online (Sandbox Code Playgroud)
要么
ax.plot_wireframe(temp[0], temp[1], temp[2])
pyplot.show()
Run Code Online (Sandbox Code Playgroud)
这是它渲染的方式plot_surface:
和使用plot_wireframe:
和使用ListSurfacePlot3D:
