Histogram fitting redrawing histograms

As I understand when doing “Fit” on an histogram, it gets redrawns, with its associated functions. However the drawing style (I just want the points, option “P”) is overwritten. How can I control that ?

Thanks !

Hi,
use goption “P” as 3. argument in h->Fit…

root [5] TH1F *h = new TH1F("hh", "hh", 100, -5, 5)
root [6] h->FillRandom("gaus")
root [7] h->Draw("P")
root [8] TF1 * f1=new TF1("f1","gaus")
root [9] h->Fit("f1","","P")

Cheers
Otto