Please read tips for efficient and successful posting and posting code
ROOT Version: 6.24/06
Platform: x86_64-centos7
Compiler: Not Provided
I obtain 1D histograms from a RDataFrame with different filters and want to plot them in a divided TCanvas. However, only the last histogram could be successfully painted. Could you please help?
Here the minimal code to reproduce the problem:
import ROOT
ROOT.gROOT.SetBatch(ROOT.kTRUE)
ROOT.gStyle.SetOptStat(0)
df = ROOT.RDataFrame("DecayTree", "demo.root")
c = ROOT.TCanvas("c", "c", 1200, 600)
c.Divide(3, 2)
for i in range(6):
c.cd(i + 1) # TCanvas.cd() starts from 1
bdt_cut = -1 + 0.1 * i
h = df.Filter(f"BDT>{bdt_cut}").Histo1D(
(
f"h{i+1}",
f"h{i+1}",
90,
5050,
5500,
),
"B_DTFDict_B_M",
)
h.Draw()
c.SaveAs("demo.pdf")