# Plot different number of entries

**URL:** <https://root-forum.cern.ch/t/plot-different-number-of-entries/17941>\
**Category:** ROOT\
**Created:** [July 21, 2014, 6:57am UTC](https://root-forum.cern.ch/t/plot-different-number-of-entries/17941 "2014-07-21T06:57:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![router](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/9de053/32.png) [@router](https://root-forum.cern.ch/u/router)\
**Post date:** [July 21, 2014, 6:57am UTC](https://root-forum.cern.ch/t/plot-different-number-of-entries/17941/1 "2014-07-21T06:57:08Z")

</div>

Hallo rooters,

I’ve got two trees with different number of entries I want to plot together in a TH1. My values are generated by a measuring system. My first tree contains the voltage values and my second tree contains the amperage values.

The measuring system records the voltage in a time step which is a bit smaller than the step of the amperage. So I get a different number of entries, but the time-range is the same. In my plot the amperage-range is too short when I plot both trees togehter.

Is there any method where I can “stretch” the binx-length?

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:** [July 21, 2014, 7:21am UTC](https://root-forum.cern.ch/t/plot-different-number-of-entries/17941/2 "2014-07-21T07:21:29Z")

</div>

> [@Can we shift histogram for several channels?](https://root-forum.cern.ch/t/can-we-shift-histogram-for-several-channels/12050/1):
>
> Good day, everyone here! Can anyone give me some informations about these two questions: 1)If I already have a histogram, can I shift this histogram for several channels in the X axis? For example, when I want to calibrate the energy spectrum, E=a\*chn+b, where “a” & “b” is the constants, “chn” is the original x axis, “E” is the new x axis. How can I realize that? 2)During my data analysis, I found that sometimes the cut sequence will affect the result. For instance, A. h1-\>Draw(“fast:slow\>\>h…

BTW. I don’t know how you fill your histograms, but you could also directly modify/scale the “x” value when you call the [TH1::Fill](http://root.cern.ch/root/html534/TH1.html#TH1:Fill) method.

---

<div class="post-metadata">

**Author:** ![router](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/9de053/32.png) [@router](https://root-forum.cern.ch/u/router)\
**Post date:** [July 21, 2014, 10:35am UTC](https://root-forum.cern.ch/t/plot-different-number-of-entries/17941/3 "2014-07-21T10:35:21Z")

</div>

Thank you for the link!

I fill my hist with the TH1::Fill method, so this is a good point. I’ll try it.
