# Plotting pion production location

**URL:** <https://root-forum.cern.ch/t/plotting-pion-production-location/31767>\
**Category:** Newbie\
**Created:** [November 26, 2018, 11:24am UTC](https://root-forum.cern.ch/t/plotting-pion-production-location/31767 "2018-11-26T11:24:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoekMeijers](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@LoekMeijers](https://root-forum.cern.ch/u/LoekMeijers)\
**Post date:** [November 26, 2018, 11:24am UTC](https://root-forum.cern.ch/t/plotting-pion-production-location/31767/1 "2018-11-26T11:24:31Z")

</div>

Hi All,

After trying to use a 2D histogram to plot the production location for pions, I found out that TH2D is probably not the class I should be using to plot this. I was wondering if someone knows how to make a simple plot of the pion production location when the x and y coordinates of all pion production locations are known.

Best,

Loek Meijers

---

<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:** [November 26, 2018, 11:47am UTC](https://root-forum.cern.ch/t/plotting-pion-production-location/31767/2 "2018-11-26T11:47:12Z")

</div>

> [@LoekMeijers](#):
>
> x and y coordinates […] are known

It looks like [TGraph](https://root.cern/doc/master/classTGraph.html) might be the answer.

---

<div class="post-metadata">

**Author:** ![LoekMeijers](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@LoekMeijers](https://root-forum.cern.ch/u/LoekMeijers)\
**Post date:** [November 26, 2018, 12:21pm UTC](https://root-forum.cern.ch/t/plotting-pion-production-location/31767/3 "2018-11-26T12:21:20Z")

</div>

Allright thanks, I’ll try using that.
