title: Python - How to arrange multiple histograms in a grid
body: <p>The following code read each row from a numpy ndarray and create multiple histograms on the same figure:</p>
  
  <pre><code>fig, ax = plt.subplots(figsize=(10, 8))
  fontP = FontProperties()
  fontP.set_size('small')
  for f in eval_list:
      local_id = getIndexByIdentifier(f)
      temp_sim = total_sim[local_id,:]
      c=np.random.rand(3,1)
      ax.hist(temp_sim, 10, ec=c, fc='none', lw=1.5, histtype='step', label=f)
      ax.legend(loc="upper left", bbox_to_anchor=(1.1,1.1),prop = fontP)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/VL3xF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VL3xF.png" alt="enter image description here"></a></p>
  
  <p>Instead of including all histograms in one plot, how can I arrange them in a grid 5 x 5? </p>
  
  <p>Here is an updated code:</p>
  
  <pre><code>#Plot indvidual Histograms
  SIZE = 10
  all_data=[]
  for f in eval_list:
      local_id = getIndexByIdentifier(f)
      temp_sim = total_sim[local_id,:]
      all_data.append(temp_sim)
  
  # create grid 10x10    
  fi, axi = plt.subplots(SIZE, SIZE,figsize=(50,50))
  for idx, data in enumerate(all_data):
      x = idx % SIZE
      y = idx // SIZE
      axi[y, x].hist(data)
  </code></pre>