I am looking for a way to draw multiple canvas in Jupyter notebook with pyROOT.
So what I am trying to do is as the following:
for hist in hist_list:
c = TCanvas("","",1200,900)
hist.Draw()
c.Draw()
and what I am expecting is that multiple different plots for the histograms will be shown. However, what I got is only the last histogram in “hist_list”, and I am guessing it is because the later canvas overrode the earlier ones.
Hi,
It might be because the canvases are garbage collected when you rebind c to a new TCanvas, and just the last one survives. I would try storing the canvases in a Python list.