to open a TBrowser directly from shell. But then I have to navigate and find my root file and open it by double click. My question is, is it possible to pass the filename as well, so that TBrowser already has that file open and shows the histogram in it? all in one go?
that’s great. Now it appears in the navigation tree under ROOT Files. But is there any way to actually display the histogram in it? Like adding a command after new TBrowser() to actually search for whatever histogram or graph is inside the root file and actually plot it on canvas?
def plot_all(filename):
f = TFile(filename)
canvas_list = []
for ii in range (f.GetNkeys()):
canvas_list.append(TCanvas(f'c{ii}', f'c{ii}', 900, 600))
ii = 0
for k in f.GetListOfKeys():
if k.GetClassName().lower().startswith('th') or k.GetClassName().lower().startswith('tgraph'):
el = f.Get(f'{k.GetName()}')
canvas_list[ii].cd()
canvas_list[ii].GetCanvasImp().ShowMenuBar()
canvas_list[ii].GetCanvasImp().ShowToolBar()
canvas_list[ii].GetCanvasImp().ShowStatusBar()
canvas_list[ii].GetCanvasImp().ShowEditor()
el.Draw()
canvas_list[ii].Draw()
which works, but has 2 problems:
all plots are plotted on the same canvas, it seems that cd() gets ignored
In the batch mode, I have to somehow tell the python interpreter to wait after plotting, not just create and close