Reputation: 763
data is like this:
x,y,z
1.1,2.2,3.3
5.5,1.45,6.77
Below is my code which can only plot a plane
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)
This is the effect I look forward to: http://philipp.spitzer.priv.at/notes/attachment/wiki/PythonPlotting/PythonPlottingSurf.png
Upvotes: 0
Views: 231