# Is there a way to extract the best fit line in fitting a 2D histogram

**URL:** <https://root-forum.cern.ch/t/is-there-a-way-to-extract-the-best-fit-line-in-fitting-a-2d-histogram/33605>\
**Category:** Newbie\
**Created:** [April 15, 2019, 8:17am UTC](https://root-forum.cern.ch/t/is-there-a-way-to-extract-the-best-fit-line-in-fitting-a-2d-histogram/33605 "2019-04-15T08:17:22Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![Thabo\_Lepota](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@Thabo\_Lepota](https://root-forum.cern.ch/u/Thabo_Lepota)\
**Post date:** [April 16, 2019, 1:36pm UTC](https://root-forum.cern.ch/t/is-there-a-way-to-extract-the-best-fit-line-in-fitting-a-2d-histogram/33605/22 "2019-04-16T13:36:18Z")

</div>

Thank you for your patience and assistance

---

<div class="post-metadata">

**Author:** ![Thabo\_Lepota](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@Thabo\_Lepota](https://root-forum.cern.ch/u/Thabo_Lepota)\
**Post date:** [April 17, 2019, 9:06am UTC](https://root-forum.cern.ch/t/is-there-a-way-to-extract-the-best-fit-line-in-fitting-a-2d-histogram/33605/23 "2019-04-17T09:06:07Z")

</div>

How can i automatically save the parameters of the best-fit line in an ascii/txt file using the same macro?

---

<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:** [April 24, 2019, 11:40am UTC](https://root-forum.cern.ch/t/is-there-a-way-to-extract-the-best-fit-line-in-fitting-a-2d-histogram/33605/24 "2019-04-24T11:40:20Z")

</div>

```auto
root [0] .> param.txt
.x basichist.C 
.>
root [3]

```

[Previous page](https://root-forum.cern.ch/t/is-there-a-way-to-extract-the-best-fit-line-in-fitting-a-2d-histogram/33605.md?page=1)
