Hello! I’m using ROOT on a Jupyter notebook and I’m having some trouble plotting histograms on the same axes. I only started using ROOT 2 days ago so I’m still very new! I’ve tried two methods:
canv = ROOT.TCanvas(“newcanvas”,“New canvas”,800,600)
hist1.Draw()
hist2.Draw(“same”)
hist3.Draw(“same”)
canv.Draw()
This seems to only plot histograms hist1 and hist2, not hist3
I also tried:
stack = ROOT.THStack(“stack”,“stack”)
stack.Add(hist1)
stack.Add(hist2)
stack.Add(hist3)
canv2 = ROOT.TCanvas(“stackcanvas”,“Stack canvas”,800,400)
stack.Draw()
canv2.Draw()
And this produces a graph which looks nothing like I expect! (presumably I have misunderstood the meaning of THStack or Add). The values that appear on the graph do not match up with those in the histogram.
Any advice would be greatly appreciated!
Thank you