22c1 = ROOT.TCanvas(
"c1",
"hists with different scales",600,400)
24ROOT.gStyle.SetOptStat(
False)
26h1 = ROOT.TH1F(
"h1",
"my histogram",100,-3,3)
28h1.Fill(np.array([ROOT.gRandom.Gaus(0, 1)
for _
in range(10000)]))
33hint1 = ROOT.TH1F(
"hint1",
"h1 bins integral",100,-3,3)
36for i
in range(1,101) :
37 sum += h1.GetBinContent(i)
38 hint1.SetBinContent(i,sum)
40rightmax = 1.1*hint1.GetMaximum()
41scale = ROOT.gPad.GetUymax()/rightmax
42hint1.SetLineColor(ROOT.kRed)
46axis = ROOT.TGaxis(ROOT.gPad.GetUxmax(),ROOT.gPad.GetUymin(),
47 ROOT.gPad.GetUxmax(), ROOT.gPad.GetUymax(),0,rightmax,510,
"+L")
48axis.SetLineColor(ROOT.kRed)
49axis.SetLabelColor(ROOT.kRed)