# Creating 2D histogram with two seperate file

**URL:** <https://root-forum.cern.ch/t/creating-2d-histogram-with-two-seperate-file/49787>\
**Category:** Newbie\
**Created:** [April 28, 2022, 6:44pm UTC](https://root-forum.cern.ch/t/creating-2d-histogram-with-two-seperate-file/49787 "2022-04-28T18:44:52Z")\
**Posts on this page:** 2\
**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, 6:44pm UTC](https://root-forum.cern.ch/t/creating-2d-histogram-with-two-seperate-file/49787/1 "2022-04-28T18:44:52Z")

</div>

I have been plotting a 2D-Histogram and I opened two different file for X and Y axis. How can I fill the plot for two seperate axis at once  
‘’'void 2DHistogram()

```
ULong64_t nEntries = currentAna->GetEntries(); 
cout << "This tree contains " << nEntries << " events!" << endl;
cout << "Loop over " << nEntries << " events!" << endl;
ULong64_t mEntries = current->GetEntries(); 
cout << "This tree contains " << mEntries << " events!" << endl;
cout << "Loop over " << mEntries << " events!" << endl;

```

‘’’

---

<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:** [April 29, 2022, 6:00am UTC](https://root-forum.cern.ch/t/creating-2d-histogram-with-two-seperate-file/49787/2 "2022-04-29T06:00:41Z")

</div>

> [@Roy](#):
>
> How can I fill the plot for two seperate axis at once

something like that ?

```auto
histo2D->fill(x,y,w);

```
