Why the figure is not the exact one?

I want to obtain a Double Yaxis figure, but the figure is wrong.
here is the root code and data file:
Double_Y.cpp (2.4 KB)
Processing: ody1…
ody1.txt (55.3 KB)
here i change the data file name “ody1” to “ody1.txt” for uploading.
the figure separately is right:
h1.pdf (20.8 KB)
h2.pdf (19.6 KB)
but the double Yaxis figure is wrong:
h1h2.pdf (50.8 KB)
the root code is exactly like the one in chapter 3 of manual of root.

I think @couet can help you with this

After “scaling” (and before “drawing”), add: h2->Sumw2(kFALSE);
or use simply: h2->Draw("SAME HIST");

Thanks, it works well.

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