# Treating a TH2 as a scatter plot

**URL:** <https://root-forum.cern.ch/t/treating-a-th2-as-a-scatter-plot/4444>\
**Category:** ROOT\
**Created:** [February 20, 2007, 5:54pm UTC](https://root-forum.cern.ch/t/treating-a-th2-as-a-scatter-plot/4444 "2007-02-20T17:54:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vigehman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/db5fbb/32.png) [@vigehman](https://root-forum.cern.ch/u/vigehman)\
**Post date:** [February 20, 2007, 5:54pm UTC](https://root-forum.cern.ch/t/treating-a-th2-as-a-scatter-plot/4444/1 "2007-02-20T17:54:31Z")

</div>

Hi there. I’m using a TH2 object to look for correlations between two variables that get calculated from my data stream. Is there a good way to treat this as a scatter plot so that I can fit a TF1 to the y variable as a function of the x variable?

Thanks,

Vic Gehman

---

<div class="post-metadata">

**Author:** ![brun](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b9e5f3/32.png) [@brun](https://root-forum.cern.ch/u/brun)\
**Post date:** [February 21, 2007, 9:32am UTC](https://root-forum.cern.ch/t/treating-a-th2-as-a-scatter-plot/4444/2 "2007-02-21T09:32:36Z")

</div>

see an example in tutorials/fit/fit2d.C

Rene

---

<div class="post-metadata">

**Author:** ![vigehman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/db5fbb/32.png) [@vigehman](https://root-forum.cern.ch/u/vigehman)\
**Post date:** [February 21, 2007, 3:04pm UTC](https://root-forum.cern.ch/t/treating-a-th2-as-a-scatter-plot/4444/3 "2007-02-21T15:04:51Z")

</div>

That did it–Thanks!

Now at the risk of sounding really needy and obnoxious, is there a way to not draw the statistics box? I tried a

```auto

```

That usually works, but I can’t seem to turn it off when I draw any of the TProfile objects I’ve created. Any suggestions?

Cheers,

Vic

---

<div class="post-metadata">

**Author:** ![brun](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b9e5f3/32.png) [@brun](https://root-forum.cern.ch/u/brun)\
**Post date:** [February 21, 2007, 4:57pm UTC](https://root-forum.cern.ch/t/treating-a-th2-as-a-scatter-plot/4444/4 "2007-02-21T16:57:42Z")

</div>

If your TProfile objects have been created before you set the style,  
you can call

` myProfile->SetStats(0);
`  
Rene

---

<div class="post-metadata">

**Author:** ![vigehman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/db5fbb/32.png) [@vigehman](https://root-forum.cern.ch/u/vigehman)\
**Post date:** [February 21, 2007, 5:06pm UTC](https://root-forum.cern.ch/t/treating-a-th2-as-a-scatter-plot/4444/5 "2007-02-21T17:06:43Z")

</div>

Thank you!
