Normalized a histogram with line but without error bar

And what is norm_h1?

T tried with
h1->Scale(1/norm);
h1->Scale(1/norm_h1);
h1->Scale(1/norm_factor);
still same error

I don’t understand what norm_h1 is. Try

Double_t norm_factor = h1->GetEntries();
h1->Scale(1/norm_factor);

If this doesn’t work, can you show what you do from the beginning?

1 Like

Thanks it works. But there is no changing in histogram’s scale.

Try redrawing your histogram.

I redraw many times, but still it’s same. Could you please elaborate how we know that our histogram is normalized to unity or not?

If you do just what’s on your screenshot, i.e.

root [1] h1->Draw("hist");
root [2] Double_t norm_factor = h1->GetEntries();
root [3] h1->Scale(1/norm_factor);

, you will still see the non-normalized histogram. However, if you do

root [4] h1->Draw("hist");

right after, you’ll see it’s normalized.

1 Like

Thank you very much @yus i did it.
Thanks a lot.

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