# 2D histogram with same file

**URL:** <https://root-forum.cern.ch/t/2d-histogram-with-same-file/49779>\
**Category:** Newbie\
**Created:** [April 28, 2022, 4:29am UTC](https://root-forum.cern.ch/t/2d-histogram-with-same-file/49779 "2022-04-28T04:29:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/roy/32/30362_2.png) [@Roy](https://root-forum.cern.ch/u/Roy)\
**Post date:** [April 28, 2022, 4:29am UTC](https://root-forum.cern.ch/t/2d-histogram-with-same-file/49779/1 "2022-04-28T04:29:40Z")

</div>

I have a same .txt file with data and UNIX time. Is there a way so that I can produce a 2D-histogram with the same txt file?

Thank You so much.

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [April 28, 2022, 5:12am UTC](https://root-forum.cern.ch/t/2d-histogram-with-same-file/49779/2 "2022-04-28T05:12:36Z")

</div>

The same way you would produce a 1D histo from a file, just with the 2 variables and with the corresponding Fill ([ROOT: TH1 Class Reference](https://root.cern/doc/master/classTH1.html#filling-histograms)).

---

<div class="post-metadata">

**Author:** ![Roy](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/roy/32/30362_2.png) [@Roy](https://root-forum.cern.ch/u/Roy)\
**Post date:** [April 28, 2022, 5:14am UTC](https://root-forum.cern.ch/t/2d-histogram-with-same-file/49779/3 "2022-04-28T05:14:19Z")

</div>

Thank You for such a quick response,

I have a data set and corresponding unix time of the data. I wanted to produce Unix time on X-axis and corresponding data on Y-axis. I am not sure how I can do that.

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [April 28, 2022, 5:17am UTC](https://root-forum.cern.ch/t/2d-histogram-with-same-file/49779/4 "2022-04-28T05:17:34Z")

</div>

Try [searching the forum](https://root-forum.cern.ch/search?q=time%20on%20axis).
