# ROOT.gStyle.SetOptFit(1111)

**URL:** <https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071>\
**Category:** Newbie\
**Created:** [March 16, 2023, 5:02pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071 "2023-03-16T17:02:12Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![L\_N](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/l_n/32/32251_2.png) [@L\_N](https://root-forum.cern.ch/u/L_N)\
**Post date:** [March 17, 2023, 3:14pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071/21 "2023-03-17T15:14:04Z")

</div>

Sorry, I meant (float)f-\>GetParameter are trustworthy and f-\>GetParameter are not?

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [March 17, 2023, 3:22pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071/22 "2023-03-17T15:22:37Z")

</div>

f-\>GetParameter is fine, it returns s double.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [March 17, 2023, 3:24pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071/24 "2023-03-17T15:24:52Z")

</div>

In TGraphPainter (my example) parameters were still converted.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 17, 2023, 3:27pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071/25 "2023-03-17T15:27:00Z")

</div>

@couet In your last plot, the parameters and their errors are fine now. However, the “chi2” and “Prob” are still converted.

```cpp
   printf("chi2 = %5.17g (%5.17g)\n", f->GetChisquare(), ((float)f->GetChisquare()));
   printf("Prob = %5.17g (%5.17g)\n", f->GetProb(), ((float)f->GetProb()));
   printf("p0 = %5.17g (%5.17g)\n", f->GetParameter(0), ((float)f->GetParameter(0)));
   printf("+- %5.17g (%5.17g)\n", f->GetParError(0), ((float)f->GetParError(0)));
   printf("p1 = %5.17g (%5.17g)\n", f->GetParameter(1), ((float)f->GetParameter(1)));
   printf("+- %5.17g (%5.17g)\n", f->GetParError(1), ((float)f->GetParError(1)));

```

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [March 17, 2023, 3:32pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071/26 "2023-03-17T15:32:14Z")

</div>

Yes I know/see . In THistPainter it is the same. I wonder why. Maybe @moneta has an idea. I agree it seems not a good idea…

---

<div class="post-metadata">

**Author:** ![L\_N](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/l_n/32/32251_2.png) [@L\_N](https://root-forum.cern.ch/u/L_N)\
**Post date:** [March 17, 2023, 3:33pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071/27 "2023-03-17T15:33:28Z")

</div>

Hi both,  
just one last question: if my extracted values were fine all along how can I change the values shown in the inset of the canvas?

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [March 17, 2023, 3:42pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071/28 "2023-03-17T15:42:56Z")

</div>

> [@L\_N](#):
>
> how can I change the values shown in the inset of the canvas?

Right now you cannot, they are converted to float. The only way would be that you draw the stats yourself with TText or via: [ROOT: TPaveStats Class Reference](https://root.cern/doc/master/classTPaveStats.html#PS03)

---

<div class="post-metadata">

**Author:** ![L\_N](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/l_n/32/32251_2.png) [@L\_N](https://root-forum.cern.ch/u/L_N)\
**Post date:** [March 17, 2023, 3:52pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071/29 "2023-03-17T15:52:33Z")

</div>

OK, thanks again a lot for your help!

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [March 17, 2023, 4:06pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071/30 "2023-03-17T16:06:08Z")

</div>

@couet, I don’t see any reason to convert these parameters to `float`, you can go ahead removing it.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [March 17, 2023, 4:28pm UTC](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071/31 "2023-03-17T16:28:59Z")

</div>

PR here: [Fit params were converted to float. by couet · Pull Request #12506 · root-project/root · GitHub](https://github.com/root-project/root/pull/12506)

[Previous page](https://root-forum.cern.ch/t/root-gstyle-setoptfit-1111/54071.md?page=1)
