title: 2-D contourplot on specific geometry in python
body: <p>I want to plot a contourplot of a specific geometry (a polygon). I have the corordinates for the corners and a number of points inside this polygon with 1-D parameters that I want to interpolate to a contourplot. I'm able to plot the distribution of the paramater but the image comes out as a square (as I do not know how to specify my geometry). 
  Needless to say I'm a Python beginner...</p>
  
  <p>I use the following code at the moment;</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import scipy.interpolate
  
  r = np.array([[0, 0, 1.0000], [0, 1.0000, 0], [1.0000, 0, 0], [0, 0.7071, 0.7071],
  [0, -0.7071, 0.7071],[0.7071, 0, 0.7071], [-0.7071, 0, 0.7071], [0.7071, 0.7071, 0], 
  [-0.7071, 0.7071, 0], [0.8361,  0.3879, 0.3879], [-0.8361, 0.3879, 0.3879], 
  [0.8361, -0.3879, 0.3879], [-0.8361, -0.3879, 0.3879], [0.3879, 0.8361, 0.3879],
  [-0.3879, 0.8361, 0.3879], [0.3879, -0.8361, 0.3879], [-0.3879, -0.8361, 0.3879],
  [0.3879, 0.3879, 0.8361], [-0.3879, 0.3879, 0.8361], [0.3879, -0.3879, 0.8361],
  [-0.3879, -0.3879, 0.8361], [-1.0000, 0, 0], [-0.7071, -0.7071, 0], [0, -1.0000, 0],
  [0.7071, -0.7071, 0]])
  
  xx = r[:,0]
  yy = r[:,1]
  zz = r[:,2]
  
  xxi, yyi = np.linspace(xx.min(), xx.max(), 100), np.linspace(yy.min(), yy.max(), 100)
  xxi, yyi = np.meshgrid(xxi, yyi)
  
  rbff = scipy.interpolate.Rbf(xx, yy, zz, function='linear')
  zzi = rbff(xxi, yyi)
  plt.imshow(zzi, vmin=zz.min(), vmax=zz.max(), origin='lower',
         extent=[xx.min(), xx.max(), yy.min(), yy.max()])
  plt.scatter(xx, yy, c=zz)
  plt.colorbar()
  plt.show()   
  </code></pre>