# Translating a th1

**URL:** <https://root-forum.cern.ch/t/translating-a-th1/41007>\
**Category:** Newbie\
**Created:** [August 16, 2020, 12:53am UTC](https://root-forum.cern.ch/t/translating-a-th1/41007 "2020-08-16T00:53:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Newbie](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/dc4da7/32.png) [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Post date:** [August 16, 2020, 12:53am UTC](https://root-forum.cern.ch/t/translating-a-th1/41007/1 "2020-08-16T00:53:22Z")

</div>

Dear, is there a simple way to translate a TH1 along the x-axis using a constant? thanks!

* * *

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [August 18, 2020, 12:33pm UTC](https://root-forum.cern.ch/t/translating-a-th1/41007/2 "2020-08-18T12:33:18Z")

</div>

@moneta can perhaps give an answer here? Thanks!

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [August 18, 2020, 4:54pm UTC](https://root-forum.cern.ch/t/translating-a-th1/41007/3 "2020-08-18T16:54:37Z")

</div>

Hi,  
No there is not such functioning ROOT. You need to create a new histogram and then copy the bin content in the new one using for example `TH1::SetBinContent`

Lorenzo

---

<div class="post-metadata">

**Author:** ![yus](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/9fc348/32.png) [@yus](https://root-forum.cern.ch/u/yus)\
**Post date:** [August 18, 2020, 5:41pm UTC](https://root-forum.cern.ch/t/translating-a-th1/41007/4 "2020-08-18T17:41:43Z")

</div>

I believe I answered a follow-up question on this from the same user yesterday:

> [@Shift a histogram along the x-axis](https://root-forum.cern.ch/t/shift-a-histogram-along-the-x-axis/41017):
>
> Dear, is there a simple way to shift a TH1 along the x-axis with a fixed constant? i.e. every bin of the histogram moves with a constant value C\_x to the left or right depending on the sign of the constant
