# Tgraph interpolation problem

**URL:** <https://root-forum.cern.ch/t/tgraph-interpolation-problem/54583>\
**Category:** Newbie\
**Created:** [April 22, 2023, 7:49pm UTC](https://root-forum.cern.ch/t/tgraph-interpolation-problem/54583 "2023-04-22T19:49:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ROOTer1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/977dab/32.png) [@ROOTer1](https://root-forum.cern.ch/u/ROOTer1)\
**Post date:** [April 22, 2023, 7:49pm UTC](https://root-forum.cern.ch/t/tgraph-interpolation-problem/54583/1 "2023-04-22T19:49:57Z")

</div>

Dear,

I have the following TGraph, and when I use the line option, the interpolation looks weird.  
Is there any fix to make sure the interpolation happens from one point to the neighbouring point?  
Many thanks!

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/6/e/6e97cfa1ad6a75e80f8b473d430a520c0af45f1c.png)

---

<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:** [April 22, 2023, 9:10pm UTC](https://root-forum.cern.ch/t/tgraph-interpolation-problem/54583/2 "2023-04-22T21:10:43Z")

</div>

Try first to execute: `graph->Sort();`

---

<div class="post-metadata">

**Author:** ![ROOTer1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/977dab/32.png) [@ROOTer1](https://root-forum.cern.ch/u/ROOTer1)\
**Post date:** [April 22, 2023, 9:12pm UTC](https://root-forum.cern.ch/t/tgraph-interpolation-problem/54583/3 "2023-04-22T21:12:43Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> graph-\>Sort()

Thank you so much Wile!
