title: How to display multiple images in one figure correctly?
body: <p>I am trying to display 20 random images on a single Figure. The images are indeed displayed, but they are overlaid. I am using:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  w=10
  h=10
  fig=plt.figure()
  for i in range(1,20):
      img = np.random.randint(10, size=(h,w))
      fig.add_subplot(i,2,1)
      plt.imshow(img)
  plt.show()
  </code></pre>
  
  <p>I would like them to appear naturally in a grid layout (say 4x5), each with the same size. Part of the problem is that I do not know what the arguments to add_subplot mean. The documentation states that the arguments are the number of rows, number of columns, and plot number. There is no positioning argument. Additionally, the plot number can only be 1 or 2. How can I achieve this?</p>