title: Lines across plots to different coordinates in matlibplot
body: <p>I am working on a project, matching image fragments to larger pieces. For example, matching Fragment to Complete in the below image.<a href="https://i.stack.imgur.com/GZu47.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GZu47.png" alt="Figure_1"></a></p>
  
  <p>Following on from <a href="https://stackoverflow.com/questions/17543359/drawing-lines-between-two-plots-in-matplotlib">this question</a>, I am trying to draw a lines across two plots to indicate matching points, with each point having different coordinates. </p>
  
  <p>This is the code that I have:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  from matplotlib.patches import ConnectionPatch
  import numpy as np
  
  (x1,y1) = (292, 21)
  (x2,y2) = (930, 1111)
  
  fig = plt.figure()
  
  a1=fig.add_subplot(1,2,1)
  imgplot = plt.imshow(fragment) #fragment is the name of the first image
  a2=fig.add_subplot(1,2,2)
  imgplot = plt.imshow(complete) #complete is the name of the second image
  
  xy1 = (x1,y1)
  xy2 = (x2,y2)
  con = ConnectionPatch(xyA=xy1, xyB=xy2, coordsA="data", coordsB="data",
                    axesA=a1, axesB=a2, color="red")
  
  a1.add_artist(con)
  
  a1.plot(x1,y1,'ro',markersize=2)
  a2.plot(x2,y2,'ro',markersize=2)
  plt.show()
  </code></pre>
  
  <p>However, the resulting image comes out with the line going behind the second image (as per below). What do I need to change in my code?</p>
  
  <p>NB: I realise I could be doing this with OpenCV.</p>
  
  <p><a href="https://i.stack.imgur.com/oaZpU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oaZpU.png" alt="Figure_2"></a></p>