title: Non-linear axes for imshow in matplotlib
body: <p>I am generating 2D arrays on log-spaced axes (for instance, the x pixel coordinates are generated using <code>logspace(log10(0.95), log10(2.08), n)</code>.</p>
  
  <p>I want to display the image using a plain old imshow, in its native resolution and scaling (I don't need <a href="https://stackoverflow.com/q/1679126/125507">to stretch it</a>; the data itself is already log scaled), but I want to add ticks, labels, lines that are in the correct place on the log axes.  How do I do this?</p>
  
  <p>Ideally I could just use commands line <code>axvline(1.5)</code> and the line would be in the correct place (58% from the left), but if the only way is to manually translate between logscale coordinates and image coordinates, that's ok, too.</p>
  
  <p>For linear axes, using <code>extents=</code> in the call to imshow does what I want, but I don't see a way to do the same thing with a log axis.</p>
  
  <p>Example:</p>
  
  <pre><code>from matplotlib.colors import LogNorm
  
  x = logspace(log10(10), log10(1000), 5)
  imshow(vstack((x,x)), extent=[10, 1000, 0, 100], cmap='gray', norm=LogNorm(), interpolation='nearest')
  axvline(100, color='red')
  </code></pre>
  
  <p>This example does not work, because extent= only applies to linear scales, so when you do axvline at 100, it does not appear in the center.  I'd like the x axis to show 10, 100, 1000, and <code>axvline(100)</code> to put a line in the center at the 100 point, while the pixels remain equally spaced.</p>