# Smoothing out a TGraph plot

**URL:** <https://root-forum.cern.ch/t/smoothing-out-a-tgraph-plot/42832>\
**Category:** Newbie\
**Created:** [December 22, 2020, 4:24pm UTC](https://root-forum.cern.ch/t/smoothing-out-a-tgraph-plot/42832 "2020-12-22T16:24:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![obitter16](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/obitter16/32/26442_2.png) [@obitter16](https://root-forum.cern.ch/u/obitter16)\
**Post date:** [December 22, 2020, 4:24pm UTC](https://root-forum.cern.ch/t/smoothing-out-a-tgraph-plot/42832/1 "2020-12-22T16:24:59Z")

</div>

Dear experts,

I’m trying to figure out if I can “smooth” a curve of a TGraph line that is plotted on a TH2D frame. I know that in the histogram itself, I can change the number of bins, but this doesn’t affect the TGraph.

As I am limited by the number of coordinates (x,y) that I’m reading into my graph, I cannot just add more data points to achieve “smoothness.”

I would appreciate any advice you might have on this matter. Thank you.

_ROOT Version:_ 6.14/04  
Built for macosx64  
From tags/v6-14-04@v6-14-04  
(I use MacBookAir.)

---

<div class="post-metadata">

**Author:** ![Dilicus](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dilicus/32/14338_2.png) [@Dilicus](https://root-forum.cern.ch/u/Dilicus)\
**Post date:** [December 22, 2020, 5:25pm UTC](https://root-forum.cern.ch/t/smoothing-out-a-tgraph-plot/42832/2 "2020-12-22T17:25:16Z")

</div>

Hi @obitter16, welcome on the ROOT forum.

When drawing the graph you can use the “C” option.

```auto
gr->Draw("ac");

```

For other options look [here](https://root.cern.ch/doc/master/classTGraphPainter.html).

Cheers,  
Stefano

---

<div class="post-metadata">

**Author:** ![obitter16](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/obitter16/32/26442_2.png) [@obitter16](https://root-forum.cern.ch/u/obitter16)\
**Post date:** [December 22, 2020, 5:49pm UTC](https://root-forum.cern.ch/t/smoothing-out-a-tgraph-plot/42832/3 "2020-12-22T17:49:44Z")

</div>

Hi Stefano,

Thank you so much! Yes, my TGraph is plotted much smoother now.

Cheers,  
Olivia

---

<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:** [December 23, 2020, 8:56am UTC](https://root-forum.cern.ch/t/smoothing-out-a-tgraph-plot/42832/4 "2020-12-23T08:56:25Z")

</div>

Be careful with option C. It might produce artefact when the graph points vary a lot.
