Plot multiple varaible-sized-bins histograms with offset

Dear experts,

I am trying to plot multiple histograms with same binning with a slight offset wrt each other in order to avoid overlapping error bars.

I have found a nice solution in, but apparently it seems to work only for standard histograms with all-same-size bins.

In my case, I have histograms with variable bin size. The minimal stand-alone macro in attachment shows the issue.

Is it an expected behaviour? If yes, do you have any elegant solution to this problem?
So far, the only way I could find is to make new histograms with variable size bins (with the offset), and then manually copy the original histogram bin content and error via SetBinContent(), SetBinError()

Many thanks in advance.


testshift.cxx (1.47 KB)

[url= we shift histogram for several channels?[/url]