14import matplotlib.pyplot
as plt
20plt.style.use(hep.style.ROOT)
21fig, ax1 = plt.subplots(figsize=(10, 6))
23h1 = ROOT.TH1F(
"h1",
"my histogram", 100, -3, 3)
25h1[...] = np.histogram(np.random.normal(0, 1, 10000), range=(-3, 3), bins=100)[0]
27hep.histplot(h1, ax=ax1, histtype=
"fill", color=
"white", edgecolor=
"blue", linewidth=1.5, alpha=0.5)
29hint1 = ROOT.TH1F(
"hint1",
"h1 bins integral", 100, -3, 3)
31hint1[...] = np.cumsum(h1.values())
34hep.histplot(hint1, ax=ax2, histtype=
"errorbar", color=
"red", marker=
"+", markersize=3)
37plt.title(
"Histogram with Cumulative Sum")