# New Method: TGraph::Interpolate

**URL:** <https://root-forum.cern.ch/t/new-method-tgraph-interpolate/24459>\
**Category:** Evolution Proposals, Apps & Ideas\
**Tags:** hist\
**Created:** [April 18, 2017, 3:07pm UTC](https://root-forum.cern.ch/t/new-method-tgraph-interpolate/24459 "2017-04-18T15:07:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksmith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksmith/32/12567_2.png) [@ksmith](https://root-forum.cern.ch/u/ksmith)\
**Post date:** [April 18, 2017, 3:07pm UTC](https://root-forum.cern.ch/t/new-method-tgraph-interpolate/24459/1 "2017-04-18T15:07:33Z")

</div>

A method for interpolation of a TGraph similar to [TH1::Interpolate](https://root.cern.ch/doc/master/classTH1.html#ad3880f90543c7e60bf3180dc1a196bcc) would be a nice addition.

---

<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 19, 2017, 7:06am UTC](https://root-forum.cern.ch/t/new-method-tgraph-interpolate/24459/2 "2017-04-19T07:06:38Z")

</div>

Seems to me the equivalent for TGraph is [Eval](https://root.cern/doc/master/classTGraph.html#a894faf9f0d66fa7f0b795be7567298c1)

---

<div class="post-metadata">

**Author:** ![ksmith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksmith/32/12567_2.png) [@ksmith](https://root-forum.cern.ch/u/ksmith)\
**Post date:** [April 19, 2017, 2:18pm UTC](https://root-forum.cern.ch/t/new-method-tgraph-interpolate/24459/3 "2017-04-19T14:18:58Z")

</div>

> [@couet](#):
>
> Seems to me the equivalent for TGraph is Eval

Ahh perfect, I missed that one. I’m a little confused as to the meaning of the following from the documentation:

> [@](#):
>
> -if spline is specified, it is used to return the interpolated value.

Does it mean that the splice object is returned and not deleted? I thought the interpolated value would be the methods return value.

---

<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 19, 2017, 2:27pm UTC](https://root-forum.cern.ch/t/new-method-tgraph-interpolate/24459/4 "2017-04-19T14:27:43Z")

</div>

> [@ksmith](#):
>
> Does it mean that the splice object is returned and not deleted? I thought the interpolated value would be the methods return value.

That’s my understanding too.

btw I have just reformatted the help of Eval which is unreadable right now.

---

<div class="post-metadata">

**Author:** ![ksmith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksmith/32/12567_2.png) [@ksmith](https://root-forum.cern.ch/u/ksmith)\
**Post date:** [April 19, 2017, 2:28pm UTC](https://root-forum.cern.ch/t/new-method-tgraph-interpolate/24459/5 "2017-04-19T14:28:56Z")

</div>

> [@couet](#):
>
> btw I have just reformatted the help of Eval which is unreadable right now.

Thanks that will be helpful.
