Quantile of a TH1 using GetQuantiles()


I’m trying to get the quantile value for 60%, and here is what I’m doing

h = ROOT.TH1F(“h”,“demo quantiles”,100,-3,3)
print h.GetQuantiles(1,q,prob)

But this is returning 1, regardless of what my histogram is, am I doing something wrong?

many thanks!


Hi! I based my example on it, but I still don’t know how to compute a single value.

My example is not working, is there anything wrong there?


The documentation Wile linked says that the return value of GetQuantiles is a single integer, the number of quantiles computed. In your example you want to print q (and maybe prob).

Thanks a lot! I thought that the function gives the quantile(s), but now it’s clear!