title: Matplotlib contour with blank areas
body: <p>I have a set of data that comprises x and y coordinates and a calculated value for each coordinate. The grid is irregular so for now i have been creating a scatter plot and separating the values into bins to display as a contour as on the img at the link below.
  <a href="http://i.stack.imgur.com/m7XHm.png" rel="nofollow">http://i.stack.imgur.com/m7XHm.png</a></p>
  
  <p>I want to refine this method by using the imshow/contour functionality in matplotlib by using meshgrid and then interpolating the calculated values. I can get this to work fine but I end up with a problem that it loses the areas of the image with no data (voids in real life) and joins them up as shown on the image at the link below for the same data.
  <a href="http://i.stack.imgur.com/ZCRog.png" rel="nofollow">http://i.stack.imgur.com/ZCRog.png</a></p>
  
  <p>I've tried to find the best way to do this but I haven't found any help on this. Does anyone have suggestions?</p>
  
  <p>I think I need to amend the method at the meshgrid stage but I'm not sure about this. For what its worth my code is below</p>
  
  <pre><code>    x=nodalData[:,1] #array of x values from input file
      y=nodalData[:,2] #array of y values from input file
  
      #define the linear grid
      xi, yi = np.linspace(x.min(), x.max(), 100), np.linspace(y.min(), y.max(), 100) 
      xi, yi = np.meshgrid(xi, yi)
  
      z=Rres #array calculated elsewhere corresponding to x,y pair
  
      #interpolate
      zi = scipy.interpolate.griddata((x, y), z, (xi, yi), method='cubic')
      #plot    
      plt.imshow(zi, vmin=z.min(), vmax=z.max(), origin='lower', extent=[x.min(), x.max(), y.min(), y.max()]) 
  </code></pre>