# Two different Binnings

**URL:** <https://root-forum.cern.ch/t/two-different-binnings/55669>\
**Category:** Newbie\
**Created:** [July 13, 2023, 8:18pm UTC](https://root-forum.cern.ch/t/two-different-binnings/55669 "2023-07-13T20:18:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_L](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ian_l/32/33898_2.png) [@Ian\_L](https://root-forum.cern.ch/u/Ian_L)\
**Post date:** [July 13, 2023, 8:18pm UTC](https://root-forum.cern.ch/t/two-different-binnings/55669/1 "2023-07-13T20:18:23Z")

</div>

Hello,

I am trying to visualize some data from a Geant4 simulation using the TBrowser, and whenever I try to adjust the binning of the histograms, I get one of two options, shown below:

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/3/3/330046a31e660653390f19c4295e95dea4a53838.png)

I get to these options by selecting View-\>Editor on the window, and then clicking on the sides of the bars of the histogram.

I am not sure why I get two different binning options, but I prefer the one on the right, since I can generate more than 100 bins. The one on the left will not allow me to visualize more than 100 bins.

The only way I have been able to get the binning style on the right is when I exclude some data from collection in the simulation.

Is there some sort of option I could use so I can increase the binning to more than 100?

Thank you

_ROOT Version:_ 6.26/10  
_Platform:_ Ubuntu 9.4.0  
_Compiler:_ Not Provided

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [July 17, 2023, 8:27am UTC](https://root-forum.cern.ch/t/two-different-binnings/55669/2 "2023-07-17T08:27:12Z")

</div>

Dear @Ian_L ,

I hope @couet can shed some light on why two binnings are different based on the options chosen, maybe there is some way in code to fix the option. I would meanwhile suggest to start by using `TH1::Rebin` to select the number of bins you want for the histogram.

Cheers,  
Vincenzo

---

<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:** [July 27, 2023, 12:07pm UTC](https://root-forum.cern.ch/t/two-different-binnings/55669/3 "2023-07-27T12:07:55Z")

</div>

I am not sure how you got the one on right. Can you provide the two histograms ?

---

<div class="post-metadata">

**Author:** ![Ian\_L](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ian_l/32/33898_2.png) [@Ian\_L](https://root-forum.cern.ch/u/Ian_L)\
**Post date:** [July 27, 2023, 5:24pm UTC](https://root-forum.cern.ch/t/two-different-binnings/55669/4 "2023-07-27T17:24:07Z")

</div>

@couet Here is the link to download the files:

> **[Transfer "Files for Root Forum" is available for download](https://www.transfernow.net/en/dltransfer?utm_source=20230727lKYhMnJ4)**
>
> Click to access the download of 2 files (34.9 MB) from the "Files for Root Forum" transfer via TransferNow

The file labelled 2e7evt should be the graph on the left, and the one labelled 2e6evt should be the one on the right.

I did the same steps to get the binning options for both graphs, and somehow got two different option sets to appear. Thanks!

Also @vpadulan I have been learning more root, and I was able to rebin these graphs to my liking. Thank you for your help!

Although I fixed my problem, I am still curious on why I have the two different settings.

---

<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:** [July 28, 2023, 7:20am UTC](https://root-forum.cern.ch/t/two-different-binnings/55669/5 "2023-07-28T07:20:29Z")

</div>

The explanation is in the [TH1Editor source file](https://root.cern/doc/master/TH1Editor_8cxx_source.html) at line 65.

---

<div class="post-metadata">

**Author:** ![Ian\_L](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ian_l/32/33898_2.png) [@Ian\_L](https://root-forum.cern.ch/u/Ian_L)\
**Post date:** [July 28, 2023, 5:31pm UTC](https://root-forum.cern.ch/t/two-different-binnings/55669/6 "2023-07-28T17:31:01Z")

</div>

Interesting. I got this data from the same Geant4 simulation, but I ran the one on the left with 10 times more events. I am not sure why it would draw the two graphs in two different ways, since they both use n-tuples.

Thank you for the explanation!
