数据是这样的:
x,y,z
1.1,2.2,3.3
5.5,1.45,6.77
下面是我的代码,它只能绘制一个平面
import numpy as np
from enthought.mayavi import mlab
x,y,zs =np.loadtxt('test',delimiter=',',usecols=(0,1,2),unpack=True,skiprows=1)
z = np.zeros((len(x), len(x)))
for xi in np.arange(len(x)):
z[xi, xi] = zs[xi]
pl = mlab.surf(x, y, z, warp_scale="auto")
mlab.axes(xlabel='x', ylabel='y', zlabel='z')
mlab.outline(pl)
这是我期待的效果:http: //philipp.spitzer.priv.at/notes/attachment/wiki/PythonPlotting/PythonPlottingSurf.png