# Get values from a 2D histogram

**URL:** <https://root-forum.cern.ch/t/get-values-from-a-2d-histogram/24669>\
**Category:** ROOT\
**Created:** [May 6, 2017, 8:10pm UTC](https://root-forum.cern.ch/t/get-values-from-a-2d-histogram/24669 "2017-05-06T20:10:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtbayat](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/cab0a1/32.png) [@mtbayat](https://root-forum.cern.ch/u/mtbayat)\
**Post date:** [May 6, 2017, 8:10pm UTC](https://root-forum.cern.ch/t/get-values-from-a-2d-histogram/24669/1 "2017-05-06T20:10:51Z")

</div>

Hi, dear ROOTers;

I have a 2D histogram in my root file. I want to get those x and y values that my histogram is filled with them. Because I want to multiply x and y values by some factors separately and generate another histogram. Is this possible?

Thanks

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [May 6, 2017, 8:14pm UTC](https://root-forum.cern.ch/t/get-values-from-a-2d-histogram/24669/2 "2017-05-06T20:14:48Z")

</div>

[Can we shift histogram for several channels?](https://root-forum.cern.ch/t/can-we-shift-histogram-for-several-channels/12050/2)

---

<div class="post-metadata">

**Author:** ![mtbayat](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/cab0a1/32.png) [@mtbayat](https://root-forum.cern.ch/u/mtbayat)\
**Post date:** [May 6, 2017, 8:18pm UTC](https://root-forum.cern.ch/t/get-values-from-a-2d-histogram/24669/3 "2017-05-06T20:18:30Z")

</div>

Unfortunately, No.  
I want to extract the values.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [May 6, 2017, 8:25pm UTC](https://root-forum.cern.ch/t/get-values-from-a-2d-histogram/24669/4 "2017-05-06T20:25:15Z")

</div>

Search for “GetBinLowEdge”, “GetBinCenter” and “GetBinWidth” in the [TH1 Class Reference](https://root.cern.ch/doc/master/classTH1.html).

---

<div class="post-metadata">

**Author:** ![mtbayat](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/cab0a1/32.png) [@mtbayat](https://root-forum.cern.ch/u/mtbayat)\
**Post date:** [May 6, 2017, 8:36pm UTC](https://root-forum.cern.ch/t/get-values-from-a-2d-histogram/24669/5 "2017-05-06T20:36:38Z")

</div>

let me ask another question: is there a way to save the values while filling this histogram to generate this histogram later whenever I want?

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [May 20, 2017, 8:41pm UTC](https://root-forum.cern.ch/t/get-values-from-a-2d-histogram/24669/6 "2017-05-20T20:41:29Z")

</div>

Closed on May 20, 2017, 8:41pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
