I think you first need to draw your histogram and only then you can FindObject(“stats”): [code]# …
hdt.Draw()
c.Update() # make sure it’s really drawn
stat1 = TPaveStats (hdt.GetListOfFunctions().FindObject(“stats”))
I have attached a mini-module that I wrote for myself for plotting multiple histograms on the same canvas, with reasonably good auto-placement of the stats boxes (and colorizing). You will definitely need to adapt it to your case, but it would at least show you which methods and names are useful. Take a look especially at the colourize_statbox, draw_stacked, movestatbox, findstatcoords, and colourize functions.