Hi all,
I find this behavior funny… And I don’t understand it
Reproducer:
import ROOT
canvas = ROOT.TCanvas()
graphs = {}
for i in range(5):
graphs[i] = ROOT.TGraph()
graphs[i].SetLineColor(i+1)
for x in range(10):
graphs[i].SetPoint(x, x, x*x + i*5)
mg = ROOT.TMultiGraph()
# mg.Add(graphs[i])
graphs[i].Draw("AL" if i ==0 else "Lsame")
print("Before update")
canvas.Update()
print("After update")
input("wait")
Why removing the comment at mg.Add(graphs[i])
gives seg. fault at canvas update?
EDIT:
Creating mg = ROOT.TMultiGraph()
out of the loop, doesn’t create a problem.
Thus, I am assuming, when TMultiGraph is deleted, it deletes all added to it Graphs?
cheers,
Bohdan
ROOT Version: 6.24/00
Platform: Centos7
Compiler: Not Provided
Python: 3.8.6