# Aligning two histograms by shifting bins

**URL:** <https://root-forum.cern.ch/t/aligning-two-histograms-by-shifting-bins/57845>\
**Category:** Newbie\
**Tags:** root\
**Created:** [January 15, 2024, 11:31am UTC](https://root-forum.cern.ch/t/aligning-two-histograms-by-shifting-bins/57845 "2024-01-15T11:31:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![utkarsh-2000](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@utkarsh-2000](https://root-forum.cern.ch/u/utkarsh-2000)\
**Post date:** [January 15, 2024, 12:40pm UTC](https://root-forum.cern.ch/t/aligning-two-histograms-by-shifting-bins/57845/3 "2024-01-15T12:40:59Z")

</div>

Hi @yus ,

Thanks a lot for pointing to the valuable thread.

> [@Can we shift histogram for several channels?](https://root-forum.cern.ch/t/can-we-shift-histogram-for-several-channels/12050/2):
>
> BTW. If you need to “scale” the contents of the histogram (i.e. not any of its axes), you can use:  
> [`TH1::Scale (Double_t c1 = 1, Option_t *option = "")`](https://root.cern/root/html534/TH1.html#TH1:Scale)  
> [`TH1::Multiply (TF1 *f1, Double_t c1 = 1)`](https://root.cern/root/html534/TH1.html#TH1:Multiply)  
> [`TH1::Divide (TF1 *f1, Double_t c1 = 1)`](https://root.cern/root/html534/TH1.html#TH1:Divide)

I think I should scale the contents, however from the documentation it seems function `TH1::Scale` only changes the contents by a **multiplicative factor** `this = this*c1`

Is it possible to change the contents by `this = this*c1 + c2`  
c2 is a constant offset

---

_[View the full topic](https://root-forum.cern.ch/t/aligning-two-histograms-by-shifting-bins/57845)._
