title: python matplotlib imshow() custom tickmarks
body: <p>I'm trying to set custom tick marks on my imshow() output, but haven't found the right combination. </p>
  
  <p>The script below summarizes my attempts. In this script, I'm trying to make the tickmarks at all even numbers on each axis instead of the default (-10,-5,0,5,10)</p>
  
  <pre><code>#!/usr/bin/env python
  import matplotlib.pyplot as plt
  import numpy as np
  
  #Generate random histogram
  N=25
  middle=N/2
  hist=np.random.random_sample((N,N))
  
  #Ticks at even numbers, data centered at 0
  ticks=np.arange(-middle,middle+2,2)
  
  extent=(-middle,middle,-middle,middle)
  plt.imshow(hist, interpolation='nearest', extent=extent, origin='lower')
  plt.colorbar()
  
  #
  #These are my attempts to set the tick marks
  #
  #plt.gcf().gca().set_ticks(ticks)
  
  #plt.gca().set_ticks(ticks)
  
  #ax=plt.axes()
  #ax.set_ticks(ticks)
  
  plt.show()
  </code></pre>
  
  <p>I'm starting to get the feeling that set_ticks() might not be the way to do it, but I'm not sure what else to try.</p>
  
  <p>Thanks!</p>