Cloning histogram causes it to become "squished"

Hello,

I have run into an interesting issue regarding cloning a histogram. I want a plot symmetric about the x axis, so I want to clone the histogram, then invert it.

After cloning the histogram, it looks like it was squished, as in it is more narrow but all of the bins have the correct value. The only operation in my code that acts on my copied histogram is to multiply it by -1.

Here is the example plot with the multiply step commented out.

Its clear to me the one on the bottom is only more narrow as it has the same shape. Also, I making this plot for 2 variables, and the issue only occurs on one of them.

Thanks for any help,
esarai

Can you post a small macro reproducing this effect ?

I figured out my problem. What I did was set the axis range for both graphs to be the same using h->GetXaxis()->SetLimits(xmin,xmax). This set the same range to spread the n bins in each histogram, so they became the same width.

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