Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 24th, 2012  |  syntax: Python  |  size: 0.48 KB  |  views: 58  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         ngrid = 500
  2.         x = np.array(lats)
  3.         y = np.array(lons)
  4.         z = np.array(data)
  5.        
  6.         xi = np.linspace(lat_min, lat_max, ngrid)
  7.         yi = np.linspace(lon_min, lon_max, ngrid)
  8.         xi, yi = np.meshgrid(xi, yi)
  9.         zi = griddata(x, y, z, xi, yi)
  10.        
  11.         # draw the map
  12.         plt.xlim(lat_min, lat_max)
  13.         plt.ylim(lon_min, lon_max)
  14.         plt.contour(xi, yi, zi, 20, linewidths=1)
  15.         plt.scatter(x, y, c=z, s=20)
clone this paste RAW Paste Data