Home | News | Documentation | Download

How do draw scale in histogram in version 6?

how do work scale function with draw line in place of histo in root version 6.10 while in root version 5.34 , it’s worked. I have given below command in my code-
h11->Scale(1.2); here 1.2 as a scaling factor.
h11->Draw(“same:l”); in case does not work in 6 version . if h11->Draw (“histo”); then worked in version 6. while in version 5, both worked.
Please give suggestion.

In ROOT 6, the TH1::Scale method automatically executes the TH1::Sumw2 method.

If you want the old ROOT 5 behaviour, try: h11->Scale(1.2, "nosw2");

@couet The “L” drawing option is broken for weighted histograms (in both ROOT versions).

If I do

root [0] hpx->Draw("L")

I get:

It seems fine. Do you have an example showing the problem ?

hpx->Sumw2(kTRUE); hpx->Draw("L");

As usual:

hpx->Sumw2(kTRUE); hpx->Draw("HIST L");

It shouldn’t be considered “usual”.
That’s a bug for me.
Just try "HIST E", which behaves properly (for weighted and unweighted histograms, in ROOT 5 and 6),
So, "HIST L", should also behave the same way (i.e. draw "HIST" and then draw "L").
And "L" alone should always simply “draw a line through the bin contents” (without error bars, because the user explicitly asks for a NONDEFAULT draw option).

Yes you are right. Note we have the same issue for the options “*”, “M” and “C”

thanks ,It’s worked.

thanks, it’s worked.