Two statistical boxes

Dear Rooters,

I came across a problem while trying to fit the same histogram with two simple gaussian functions, as I wanted two separated statistical boxes. I have not been able to do this, although I’ve dried several times.

I have managed to do something by superimposing two histograms and using the option Draw(“sames”): finally I ended up with two statistical boxes. But I still have a problem, which I try to explain by using the attached file. stat_box.C is just the tutorial multifit.C, rearranged.
If you run it you can see that there are two statistical boxes, one for each histogram. The two histograms are superimposed. The problem arises when I try to fit also the second one. If you uncomment the two lines at the end you hide the first histogram. How is possibile to fix this?

I hope I have been clear and I thank you all for the help,
stat_box.C (1.41 KB)

[url]How to move statistics box when using Draw("sames"
[url]Print in Graph Legend fit parameters
[url]Cannot print Stats correctly

Thank you very much!