# Order of printed parameters in stat box

**URL:** <https://root-forum.cern.ch/t/order-of-printed-parameters-in-stat-box/58777>\
**Category:** Newbie\
**Tags:** root\
**Created:** [March 29, 2024, 12:18pm UTC](https://root-forum.cern.ch/t/order-of-printed-parameters-in-stat-box/58777 "2024-03-29T12:18:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liz](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/liz/32/36077_2.png) [@liz](https://root-forum.cern.ch/u/liz)\
**Post date:** [March 29, 2024, 12:18pm UTC](https://root-forum.cern.ch/t/order-of-printed-parameters-in-stat-box/58777/1 "2024-03-29T12:18:32Z")

</div>

Hello, does anybody know how can i change the order of the fit results shown in the stats box? I can see they are printed out alphabetically but I would like to customize the order. I wuld also like to change the title if possible.  
Thanks 🙂

 ![Screenshot 2024-03-29 131748](https://root-forum.cern.ch/uploads/default/original/3X/3/c/3c78941d883e127cbf762c57b9ce9783e41b87f6.png)

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [March 29, 2024, 1:17pm UTC](https://root-forum.cern.ch/t/order-of-printed-parameters-in-stat-box/58777/2 "2024-03-29T13:17:09Z")

</div>

Not sure about how to re-order lines (maybe @couet knows), but for the title, starting from the [statsEditing.8C](https://root.cern/doc/master/statsEditing_8C.html) tutorial, you can try something like:

```auto
   // Retrieve the stat box
   TPaveStats *ps = (TPaveStats*)canvas->GetPrimitive("stats");
   ps->SetName("mystats");
   TText *tconst = ps->GetLine(0);
   tconst->SetTitle("your new title");
   // the following line is needed to avoid that the automatic redrawing of stats
   h->SetStats(0);
   canvas->Modified();

```

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [March 29, 2024, 1:44pm UTC](https://root-forum.cern.ch/t/order-of-printed-parameters-in-stat-box/58777/3 "2024-03-29T13:44:19Z")

</div>

See the example on “Statistics box editing”:  
[https://root.cern/doc/master/classTPaveStats.html#PS03](https://root.cern/doc/master/classTPaveStats.html#PS03)  
In short, you get a TList of the entries and then you can Add or Remove lines as you want; if you are going to move around many, it may be easier to just create your own TPaveStats. Note that you will have to enter the values yourself, since there’s no function to “add the RMS entry”, etc.; you add the text you want.
