gStyle->SetOptFit(); and TH2F *frame

Hi, I am plotting a 1D histogram on a TH2F frame (where I define both X and Y ranges). On this 1D histo, I do a fit (with a Gaussian). I would like to have the usual Fit Box on the top-right of the canvas, but I can’t. Do you have any useful suggestion?
I attach here the macro, in case it helps…
Thanks in advance for your help!
Cheers, Davide
Pressure.C (4.07 KB)

Your macro takes ages to execute. Attached is a fast similar one doing what you want.
vahe.C (1000 Bytes)