Hi I wonder if someone can help me.
I am trying to do the following:
Fill a TH2 with binned data (pre-defined axis limits and bins) with SetBinContent()
Draw the histogram on a new axis with extended axis range.
So I try this:
kernel_hist = TH2F("kernel", "Kernel PDF", 100, phsp.lowerLimit(1), phsp.upperLimit(1),
100, phsp.lowerLimit(2), phsp.upperLimit(2))
for i in range(100):
for j in range(100):
kernel_hist.SetBinContent(i, j, hist2d[i,j])
Hi so when I try SetRangeUser it seems to have no effect and the axes have the original limits. This has been mentioned in previous questions on the forum but I can’t find a solution. Any other ideas?
I’m afraid this did not work either.
The solution I found was to redefine the bins to leave some empty bins on either side of my histogram. This is a bit of a work-around though since the binning was predefined so had to add bins of a certain size and leave the content as zero in order to get a wider axis range.