Hi,
to help you we need your complete macro+ histo
and your complete log.
You only show the output of Minuit which looks fine
At least the following works as expected.
void fitp1()
{
auto f1 = new TF1("f1", "pol1", 0, 100);
f1->SetParameters(0, 0.1);
auto h1 = new TH1F("h1", "h1", 100, 0, 100);
h1->FillRandom("f1");
h1->Draw();
f1->SetParameters(1, 0.5);
h1->Fit("f1");
printf("p0 = %f p1 = %f\n",
f1->GetParameter(0), f1->GetParameter(1));
}
Otto