title: How to plot bars next to each other?
body: <p>I have a histogram with 4 different objects on each bin, that now are stacked on top of each other. Instead, I need to plot the different objects side by side within the same histogram bin (similar to the top left plot in <a href="https://matplotlib.org/3.1.1/gallery/statistics/histogram_multihist.html" rel="nofollow noreferrer">https://matplotlib.org/3.1.1/gallery/statistics/histogram_multihist.html</a>):</p>
  <pre><code>bins=np.logspace(np.log10(0.01),np.log10(20), 11)
  
  plt.hist(a[nosfr]/1e+11, bins, color='red', fill=True, linewidth=2, density=True, histtype='bar', edgecolor='k')
  
  plt.hist(a[highsfr]/1e+11, bins, color='orange', fill=True, linewidth=2, density=True, histtype='bar', edgecolor='k')
  
  plt.hist(b[mynosfr]/1e+11, bins, color='blue', edgecolor='k', fill=True, linewidth=2, density=True, alpha=0.7, histtype='bar')
  
  plt.hist(b[myhighsfr]/1e+11, bins, color='cyan', edgecolor='k', fill=True, linewidth=2, density=True, alpha=0.7, histtype='bar')
  
  plt.xscale('log')
  plt.xlim(2e-2, 2e+1)
  </code></pre>
  <p><code>[nosfr]</code>, <code>[highsfr]</code> etc. draw objects with different criteria within the same sample (<code>a</code> and <code>b</code>). All the examples I've looked at are slightly different from what I need, and I can't find the right way. Thanks!</p>