Probably, it has been already asked, but the proposed solutions (SetUserRange) could not work for me - What I want to do, is this - I do have collection of TH1 , and want to redraw all of them in a dynamic way so to omit the empty parts of the histos - For example, how is it possible to get rid of the empty left and right bins like in the attached histo ? I dont really care keeping or not the initial number of bins.
Although this works in principle, the problem is that only the last histo of the stack (the sum) is drawn, meaning that you loose the color-code due to the “stacking” in the first place - In other words, how would be possible to change the range dynamically, but still get the full collection of the TStack in the final plot ?
You should use the “SUM” only for the purpose of finding the first and the last nonzero bins. Draw the “full” THStack (e.g. with “NOSTACK”) and then “limit” the x-axis according to the found nonzero bins.