title: Figure.transFigure.transform() : lines in figure coordinates do not scale with the figure
body: <p>I am trying to draw lines in figure coordinates using the <code>Figure.transFigure.transform()</code> functionality, but either I don't fully understand it or something else goes wrong. According to the <a href="https://matplotlib.org/2.0.2/users/transforms_tutorial.html" rel="nofollow noreferrer">Matplotlib Documentation</a>, <code>transFigure</code> should be</p>
  
  <blockquote>
    <p>The coordinate system of the Figure; (0,0) is bottom left of the
    figure, and (1,1) is top right of the figure.</p>
  </blockquote>
  
  <p>However, if I write a small test program that should draw a diagonal line from the bottom left to the top right corner of the <code>Figure</code> (not the <code>Axes</code>), this only draws the line correctly in the original figure. Once the figure is resized, the line does not anymore end in the upper right corner. Below a small test program to illustrate this behaviour:</p>
  
  <pre><code>from matplotlib import pyplot as plt
  from matplotlib import lines
  import numpy as np
  
  x = np.linspace(0,1,100)
  
  X = np.array([0.0,1.0])
  Y = np.array([0.0,1.0])
  
  fig, ax = plt.subplots()
  
  ax.plot(x, np.cos(x))
  X0, Y0 = fig.transFigure.transform([X,Y])
  
  line1 = lines.Line2D(X0, Y0, color='r', lw = 5)
  fig.lines.append(line1)
  
  plt.show()
  </code></pre>
  
  <p>...and the resulting figure after an arbitrary resize:</p>
  
  <p><a href="https://i.stack.imgur.com/A4YSG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A4YSG.png" alt="figure that results from the above code after resizing"></a></p>