ROOT.TCanvas is not persistent and hence there are no change to manipulate manually.
If I am not correct please let me know how to do that, otherwise is there any development to provide that.
Thanks
Soumen
Is your canvas “c” created in a function that returns? If it’s a global variable it should stick around, but if it’s in a function, you need to return the “c” (along with any TGraphs, TArrows, TLegends etc) otherwise the python garbage collection deletes them. E.g.:
def make_graph():
c = ROOT.TCanvas()
h = ROOT.TH1D("h","h",10,0,10)
h.Draw()
return c,h
// Global scope
c,h = make_graph()
import ROOT
def make_graph():
c = ROOT.TCanvas()
h = ROOT.TH1D(“h”,“h”,10,0,10)
h.Draw()
return c,h
if name==“main”:
c,h = make_graph()
c.SaveAs(‘cvs.png’)
I agree, say for example this piece of code will save my canvas, but if write simmilar code in c++ the canvas is drawn on a TBrowser, and we can edit (change axis label or anything else) the Canvas on the TBrowser and then we can save that after some manipulation. But this python code does not give me that facility.