# Fit with a polynomial

**URL:** <https://root-forum.cern.ch/t/fit-with-a-polynomial/40576>\
**Category:** Newbie\
**Created:** [July 22, 2020, 8:43pm UTC](https://root-forum.cern.ch/t/fit-with-a-polynomial/40576 "2020-07-22T20:43:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Newbie](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/dc4da7/32.png) [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Post date:** [July 22, 2020, 8:43pm UTC](https://root-forum.cern.ch/t/fit-with-a-polynomial/40576/1 "2020-07-22T20:43:47Z")

</div>

Dear,

I want to fit the following ratio plot with a polynomial,

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/0/c/0c42a1a98cd846b2508872df18e638f236e6475d.png)  
However, only the first order is working, but it doesn’t look linear at all

Are there tips to make higher-order polynomial work? could it be the binning? or is it just impossible?

---

<div class="post-metadata">

**Author:** ![hammiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hammiu/32/20395_2.png) [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Post date:** [July 23, 2020, 3:58am UTC](https://root-forum.cern.ch/t/fit-with-a-polynomial/40576/2 "2020-07-23T03:58:49Z")

</div>

Could you post your data? I hope I can help you.

---

<div class="post-metadata">

**Author:** ![Newbie](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/dc4da7/32.png) [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Post date:** [July 23, 2020, 9:23am UTC](https://root-forum.cern.ch/t/fit-with-a-polynomial/40576/3 "2020-07-23T09:23:11Z")

</div>

[RatioPlotEntries.txt](https://root-forum.cern.ch/uploads/short-url/5Uq7Aurb45BjZwUgPHmHrXj4uL2.txt) (2.7 KB)

Hi Hammiu! here are the values, thanks a lot for your help!

---

<div class="post-metadata">

**Author:** ![hammiu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hammiu/32/20395_2.png) [@hammiu](https://root-forum.cern.ch/u/hammiu)\
**Post date:** [July 23, 2020, 9:50am UTC](https://root-forum.cern.ch/t/fit-with-a-polynomial/40576/4 "2020-07-23T09:50:43Z")

</div>

I think you need to know form of function which you want to fit. Second order function has 1 maximum or 1 minimum. You know, your graph can not fit by that function. If you can try, big error will be.
