title: Add x=y (45 degree) line within matplotlib axis limits
body: <p>I have a plot with different x- and y-limits:</p>
  
  <pre><code>fig, ax = subplots(ncols=1)
  ax.set_xlim([0, 10])
  ax.set_ylim([5, 10])
  </code></pre>
  
  <p>I would like to add an <code>x=y</code> line to this plot, but keep the line within the axis limits.</p>
  
  <p>My first, naive attempt is just</p>
  
  <pre><code>ax.plot(ax.get_xlim(), ax.get_xlim())
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Z6pFR.png" alt="First, naive attempt"></p>
  
  <p>An improved attempt works, but is incredibly ugly, code-wise:</p>
  
  <pre><code>ax.plot([max(ax.get_xlim()[0], ax.get_ylim()[0]), 
           min(ax.get_xlim()[1], ax.get_ylim()[1])],
          [max(ax.get_xlim()[0], ax.get_ylim()[0]), 
           min(ax.get_xlim()[1], ax.get_ylim()[1])])
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ACmWa.png" alt="enter image description here"></p>
  
  <p>Is there a nicer way?
  I'm using IPython version <code>1.2.1</code> inside Spyder <code>2.2.5</code> on Matplotlib version <code>1.3.1</code> and <code>mpl.get_backend()</code> returns:</p>
  
  <pre><code>'module://IPython.kernel.zmq.pylab.backend_inline'
  </code></pre>