I’m plotting a histogram from an ntuple, I get the contents of each bin and what I then want to do is re-draw the histogram excluding any bins whose contents is greater than 15. I can’t find a way of doing this, what is the easiest way?

It is not clear what you expect to see as a result?
-set the corresponding bins to 0?
if (yes) loop on all bins with content than 15 and set the content to 0,ie
for (int i=1;i<=nbins;i++} if (h.GetBinContent(i) >15) h.SetBinContentI,0);
-Set the maximum scale on y to be 15?
if yes call h.SetMaximum(15);

In this code 31 bins are set to zero but when I draw the histogram again I get 31 more entries than I did before I applied the cut. Is there a solution for this?

Thank you for your help. I have one more quick question… the number of entries in my histogram is now 2485, which is the same as before I applied the cut. Why is it not this value minus the number of entries in the bins that I have excluded?