title: Draw grid lines over an image
body: <p>I am following <a href="https://stackoverflow.com/questions/20368413/draw-grid-lines-over-an-image-in-matplotlib">this answer</a> but I do not get grid lines every 10 steps:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  plt.figure()
  img=ims[0].copy()
  dx, dy = 10,10
  
  # Custom (rgb) grid color
  grid_color = -1500
  
  # Modify the image to include the grid
  img[:,::dy] = grid_color
  img[::dx,:] = grid_color
  
  plt.imshow(img,'gray',interpolation='none',vmin=-1500,vmax=2258)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YNc5Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YNc5Y.png" alt="enter image description here"></a></p>