How to include fit parameters when writing histogram to file

Please read tips for efficient and successful posting and posting code

ROOT Version: 6.20/04
Platform: Ubuntu
Compiler: Not Provided


I am trying to include fit parameters in the stat box of a histogram (TH1F) that is written to a root file. I have


in my code so that the stat box will show the specified values (chi squared, etc.) when drawing the histogram. However, when the histogram is written to a root file, the stat box only includes the default values (entries, mean, std dev).

Is there a way to include the fit parameters in the stat box of the histogram that gets written to the file?


I think it’s not that the info is not “included”, but just not shown by default, see the note on SetOptFit; try putting those gStyle options in your rootlogon.C file.