title: How to use griddata from scipy.interpolate
body: <p>I have a three-column (x-pixel, y-pixel, z-value) data with one million lines. The data is from an image and there are duplicated z-values. Now I need to make a surface plot. <a href="http://www.mathworks.cn/help/matlab/ref/griddata_ex1.png" rel="noreferrer">This image</a> is a perfect example. But now the  output image is null. Could someone check the code please?</p>
  
  <pre><code>import numpy as np
  from enthought.mayavi import mlab
  from scipy.interpolate import griddata
  x,y,z = np.loadtxt('test.csv',delimiter=',',usecols=(0,1,2),unpack=True) 
  xi,yi = np.mgrid[0:3000:3000j, 0:3000:3000j]
  zi = griddata((x, y), z, (xi, yi),method='linear')
  mlab.surf(xi,yi,zi)
  mlab.show()
  </code></pre>