Skip to content Skip to sidebar Skip to footer

Plotting A 3d Data Read From A File Using Mayavi

I have a data file in the following format: x y z f(x) f(y) f(z) I want to plot it using contour3d of mayavi: def fill_array(output_array,source_array,nx,ny,nz,position): for

Solution 1:

It worked.
I added the following just after reading the file (rest code remaining same):

data_file = np.loadtxt('datafile', 
dtype=[('x',float),('y',float),('z',float),('fx',float),('fy',float),('fz',float)])
data_file = np.sort(data_file,order=['z','y'])
f = np.array(data_file).reshape(nx,ny,nz)

Post a Comment for "Plotting A 3d Data Read From A File Using Mayavi"