ny, nx = 512, 115
xi = np.linspace(xmin, xmax, nx)
yi = np.linspace(ymin, ymax, ny)
xi, yi = np.meshgrid(xi, yi)
zi = mlab.griddata(x, y, z, xi, yi)
plt.figure()
plt.pcolormesh(xi, yi, zi)
plt.scatter(x, y, c=z)
plt.colorbar()
plt.axis([xmin, xmax, ymin, ymax])
plt.show()
Resampling irregularly spaced data to a regular grid in Python