Horizontal line through zero bin content

Hi Everyone,

I am trying to plot two 1D histograms on the
same canvas with non-zero bin contents from 0 to 0.7. However, the histograms produced also draw a line over zero bin contents. Is it possible to get rid of this line?

I went through the old post by @couet answering a similar question however the SetMinmum(0) option seems to have no effect. Can someone please help me determine where I am making a mistake or how to remove this line?

Thanks a lot for your time and consideration!

Edit1: I think the SetMinium(0) histogram seems to work. However, there is an issue when I plot another histogram on the same canvas

h8->SetMinimum(0)
h8->Draw()

h9->SetMinimum(0)
h9->Draw()

h8->Draw("same")

What I see on your plot is not “a line at 0” but the bins after the high peaks having 0 as content. That’s the “red line” overwriting the axis . You need to redraw the axis with:

gPad->RedrawAxis();
1 Like

Thanks a lot for your prompt reply and accurate solution !

By the way, is the Redraw() axis option something we shall do always while plotting multiple graphs ?

It depends what users want. Sometimes one want to see the bin drawn even if it is on the axis. That’s why we cannot make it automatic by default…

Yes, that’s quite reasonable