Gstyle not working

Dear ROOT experts,

I am trying to save two fitted histograms in two separate canvases with a legend that contains useful info about the histogram and the fit. However, somehow, it works well on one canvas but not on the other. I don’t understand why as both are being constructed in exactly the same way. Please can you help me figure out where I am going wrong?

Note: It works as expected if I change GetOptFit() parameters to 1111 when I open the canvas using TBrowser.

Code, figures and data file are attached:
rootforum.cpp (2.2 KB) rootforum.pdf (418.3 KB)
Data file

Thank you!
Cheers,
Ruina

I get:

Error in <TFile::TFile>: file myInputFile.root does not exist

Can you post the data file ?

Yes, I’ve added a link to it

rootforum.cpp (2.1 KB)

Thanks a ton!
But I didn’t understand exactly what was going wrong with second canvas?

I changed several things, name canvases, do not plot the fit at the Fit command etc …

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.