21c1 = ROOT.TCanvas(
"c1",
"hists with different scales",600,400)
23ROOT.gStyle.SetOptStat(
False)
25h1 = ROOT.TH1F(
"h1",
"my histogram",100,-3,3)
27for i
in range(10000) :
28 h1.Fill(ROOT.gRandom.Gaus(0,1))
32hint1 = ROOT.TH1F(
"hint1",
"h1 bins integral",100,-3,3)
35for i
in range(1,101) :
36 sum += h1.GetBinContent(i)
37 hint1.SetBinContent(i,sum)
39rightmax = 1.1*hint1.GetMaximum();
40scale = ROOT.gPad.GetUymax()/rightmax;
41hint1.SetLineColor(ROOT.kRed)
45axis = ROOT.TGaxis(ROOT.gPad.GetUxmax(),ROOT.gPad.GetUymin(),
46 ROOT.gPad.GetUxmax(), ROOT.gPad.GetUymax(),0,rightmax,510,
"+L")
47axis.SetLineColor(ROOT.kRed)
48axis.SetLabelColor(ROOT.kRed)