title: Overlaying a lineCollection on a plot in matplotlib - how to get the two to line up.
body: <p>I'm trying to do a heat map over a shape file in python. I need to make quite a few of these so don't want to read in the .shp every time. </p>
  
  <p>Instead, I thought I could create a lineCollection instance of the map boundaries and overlay the two images. Problem is - I can't seem to get the two to line up correctly. </p>
  
  <p>Here is the code, where linecol is the lineCollection object. </p>
  
  <pre><code>fig = plt.figure()
  ax = fig.add_subplot(111)
  ax.contourf(xi,yi,zi)
  ax.add_collection(linecol, autolim = False)
  plt.show()
  </code></pre>
  
  <p>Is there an easy way to fix the limits of linecol to match those of the other plot? I've had a play with set_xlim and transforms.Bbox, but can't seem to manage it. </p>
  
  <p>Thank you very much for your help!</p>