# Problem in 2D fitting

**URL:** <https://root-forum.cern.ch/t/problem-in-2d-fitting/52886>\
**Category:** Newbie\
**Created:** [December 23, 2022, 4:00pm UTC](https://root-forum.cern.ch/t/problem-in-2d-fitting/52886 "2022-12-23T16:00:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gini](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/gini/32/29467_2.png) [@gini](https://root-forum.cern.ch/u/gini)\
**Post date:** [December 23, 2022, 4:00pm UTC](https://root-forum.cern.ch/t/problem-in-2d-fitting/52886/1 "2022-12-23T16:00:16Z")

</div>

Hi,

I want to do 2D fitting by specifying the x and y boundaries and using the binned likelihood method, but unfortunately, I have the following error.:

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/a/d/ad7ff4f653f55d8dbaa4b350891e87bc90278a62.png)

Can someone tell how to resolve this ?

Thanks

---

<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:** [December 23, 2022, 4:19pm UTC](https://root-forum.cern.ch/t/problem-in-2d-fitting/52886/2 "2022-12-23T16:19:59Z")

</div>

I guess you need to set [the “X” and “Y” ranges](https://root.cern/doc/master/classTF2.html#a5685debe1485ef0470d078ab58e7e9d8) for your fit function and then fit your histogram adding [the `"R"` fit option](https://root.cern/doc/master/classTH1.html#a7e7d34c91d5ebab4fc9bba3ca47dabdd) (without explicitly setting “`xmin`” and “`xmax`”).
