Adding "gaps" between specific bins in TH1

I can think of a few workarounds (e.g. just plotting multiple histograms), however I’m wondering if there’s a more straight-forward way to add “gaps” between certain bins of a single 1D histogram.

For example, you can imagine a histogram with counts “clustered” at integer intervals (e.g. narrow Gaussians centered at 1, 2, 3, …). I may want to plot only the ranges 0.75 - 1.25, 1.75 - 2.25, 2.75 - 3.25, etc.

Something like this crude sketch:

The simplest: Find a cutoff value in y and use histo->SetMinimum(somevalue) to view the histo only above that value. Alternative: don’t fill the bins in the regions you want to see empty, or use SetBinContent to set them to zero.

1 Like

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