title: Manually-defined axis labels for Matplotlib imshow()
body: <p>The following code:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  
  data = np.random.randint(0, 100, size=(10, 10))
  plt.imshow(data, cmap='jet', interpolation='nearest')
  plt.show()
  </code></pre>
  
  <p>Gives the following figure:</p>
  
  <p><a href="https://i.stack.imgur.com/caB96.png" rel="noreferrer"><img src="https://i.stack.imgur.com/caB96.png" alt="enter image description here"></a></p>
  
  <p>However, instead of the axis labels corresponding to the index in the array, I want to manually define them. For example, instead of the axis labels being (0, 2, 4, 6, 8) as above, I want them to be (0, 10, 20, 30 ...).</p>
  
  <p>Here is the code I have tried for this:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  
  data = np.random.randint(0, 100, size=(10, 10))
  labels = range(0, 100, 10)
  plt.imshow(data, cmap='jet', interpolation='nearest')
  plt.xticks(labels)
  plt.yticks(labels)
  plt.show()
  </code></pre>
  
  <p>However, this gives the following figure:</p>
  
  <p><a href="https://i.stack.imgur.com/6TQCv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6TQCv.png" alt="enter image description here"></a></p>
  
  <p>How can I achieve a figure with an appearance like the first one, but with axis labels like the second one?</p>