# Problem whith increasing numbers of bins

Hello,
I want to increase number of bins in this graph but this option is not available and I can only decrease it. This is happening with this specific case only.
Please can you suggest me what I could do?
Thank you,
A.

Hi papagaj,
It’s not possible.
A histogram contains only information about the number of bins and the entries of each bin.
The information about the data you use to fill are lost.

So when you want change the number of bin you can only decrease it,because to do it you put together bins.

What you can do it’s declare the histogram with a large number of bins and then rebinning it until you are satisfied.
In this way you can found the binning you prefer for plotting your data.

Cheers,
Stefano

Here I can decrease and increase number of bins, as you can see:

In both cases I used “colz” command and I did not set number of bins (program did it automatically) and in first case i can only to reduce number, but in second case and all others that I meet up to now I could reduse or increase number by my wish (up to limit set by number of my data).

The figure you are showing is a histogram generated from a `TTree`. As I understand the number of bins can be increased as the histogram is linked to the source data and a new histogram can be generated. A histogram that is unaware of its source has no method to determine how many counts in each bin corresponded to smaller bins.

Both histograms are created from the same source of data in the same way, so I really do not see how in the first case it lost connection with data and in the second it did not. Second picture has been made only by introducing “cut_ks” in the first graph (it is graphical cut of the first picture).

I have just done some tests.
Seems that when you draw a 2D - histogram from aa TTree both if you don’t declare a the number of bins/ or you declare it to be smaller than 1000. The histogram is made with 1000 bin along x axis and 1000 bins along y axis.

So you can increase the number up to 1000 from the draw panel.

In the case you declare the number of bin to be larger than 1000, when you try to increase or decrease it, the number go down to 1000 and then you cannot increase anymore, but you have to redraw the histogram

cheers,
Stefano

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