# Range of fit function

**URL:** <https://root-forum.cern.ch/t/range-of-fit-function/18468>\
**Category:** ROOT\
**Created:** [November 11, 2014, 12:20pm UTC](https://root-forum.cern.ch/t/range-of-fit-function/18468 "2014-11-11T12:20:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![y33t](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/50afbb/32.png) [@y33t](https://root-forum.cern.ch/u/y33t)\
**Post date:** [November 11, 2014, 12:20pm UTC](https://root-forum.cern.ch/t/range-of-fit-function/18468/1 "2014-11-11T12:20:34Z")

</div>

Hi All,

I do fit my histogram using ;

```auto

```

and it works as expected but when I try to fit only a specific part of the histogram ;

```auto

```

the range of the histogram changes completely. I would like to shrink the size of the fit to my specified values (minval,maxval) not the histogram. I checked out the docs but couldn’t find a relevant function. Any ideas ?

Cheers

---

<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:** [November 11, 2014, 12:28pm UTC](https://root-forum.cern.ch/t/range-of-fit-function/18468/2 "2014-11-11T12:28:41Z")

</div>

See the “R” option of the [TH1::Fit](http://root.cern.ch/root/html/TH1.html#TH1:Fit@1) method.
