title: Plotting two different sized grids. Smaller grid centred on the centre of the bigger
body: <p>I am trying to get something like this (image the image is fully populated with the red squares (I only drew a few)): <img src="https://i.stack.imgur.com/GQeKZ.png" alt="enter image description here">. Expanding on what I want: I want the RED squares to be centred int the YELLOW squares as shown in the picture (but with RED squares in ALL the YELLOW squares).</p>
  
  <p>What is happening there is the bigger windows (yellow grid) are overlapped between each other by half their size, where the smaller windows in this case, half the size of the big window, (red square) are centred on the centre of the big window. The furthest I could get was using this <a href="https://stackoverflow.com/questions/1729995/multiple-grids-on-matplotlib">Multiple grids on matplotlib</a> I am basically using their code, but to make things absolutely clear, I include the code:</p>
  
  <p><strong>EDIT:</strong> Thanks to Rutgers I got what I wanted. Here is a slightly edited and shortened version. This code gives the first centre of the four yellow grid intersection where I want.</p>
  
  <pre><code>import matplotlib.pyplot as plt
  from matplotlib.pyplot import subplot
  from scipy.misc import imread
  import numpy as np
  import matplotlib.cm as cmps
  import matplotlib.collections as collections
  
  
  i = 1
  initial_frame = 1
  
  
  ax = subplot(111)
  
  
  bg = imread("./png/frame_" + str("%05d" % (i + initial_frame) ) + ".png").astype(np.float64)
  
  # define the normal (yellow) grid
  ytcks = np.arange(16,bg.shape[0],32)
  xtcks = np.arange(16,bg.shape[1],32)
  
  # plot the sample data
  ax.imshow(bg, cmap=plt.cm.Greys_r, interpolation='none')
  
  ax.set_xticks(xtcks)
  ax.set_xticks(xtcks+16, minor=True)
  
  ax.set_yticks(ytcks)
  ax.set_yticks(ytcks+16, minor=True)
  
  ax.xaxis.grid(True,'minor', linestyle='--', lw=1., color='y')
  ax.yaxis.grid(True,'minor', linestyle='--', lw=1., color='y')
  
  ax.xaxis.grid(True,'major', linestyle='--', lw=0.5, color='g')
  ax.yaxis.grid(True,'major', linestyle='--', lw=0.5, color='g')
  
  plt.show()
  </code></pre>