Usage of hist library in notebooks can be beneficial over np.histogram, including handling uncertainties and also convenient access to plotting functionality: https://hist.readthedocs.io/.
Example and suggestion from @alexander-held below.
import hist
h = hist.Hist.new.Regular(60, 100, 160, label="di-photon invariant mass $m_{yy}$ [GeV]", flow=False).Double()
before your iterate loop starts and then inside your loop
and finally
fig, ax = plt.subplots()
h.plot(ax=ax, histtype="errorbar", color="black", label="Data")
ax.set_ylabel("Events / 1 GeV")
ax.set_ylim([0, ax.get_ylim()[1]*1.1])
ax.set_xlim([100, 160])
ax.legend( frameon=False )
produces a plot very similar to the one being done right now.
Originally posted by @alexander-held in #75 (comment)