Histogram title

Dear Couet,

  • ok thank you. now it’s working or the title size.
  • the code (1) still does not work with “GetLowerRefGraph” at line 127. When I run I still have the error message (2) like it does not find the graph. Do you see what is wrong? When I run the code without this I have the warning (3), but I do not see where this is comming because all the bins are fill. Do you have an idea?
    Regards

(1)
http://calpas.web.cern.ch/calpas/plot.cc
http://calpas.web.cern.ch/calpas/hist.root
http://calpas.web.cern.ch/calpas/rootstyle.cc

(2)
warning: null passed to a callee that requires a non-null argument [-Wnonnull]
ratio -> GetLowerRefGraph() -> SetMinimum(-1);

(3)
Warning in TGraphAsymmErrors::Divide: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in TGraphAsymmErrors::Divide: Number of graph points is different than histogram bins - 56 points have been skipped

(2) Move ratio->Draw(); at least 2 lines up (i.e. ahead of the first “GetLowerRefGraph” call).
(3) Most probably, some data points are 0 and then they are skipped (you will probably see them if you comment out / remove all “SetRangeUser” calls).

I just ran your macro. I do not see the error you mentioned. I get:

root plot.cc
   -------------------------------------------------------------------
  | Welcome to ROOT 6.15/01                       http://root.cern.ch |
  |                                      (c) 1995-2018, The ROOT Team |
  | Built for macosx64                                                |
  | From heads/master@v6-13-04-886-gcea240d1e8, Aug 09 2018, 11:10:02 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'        |
   -------------------------------------------------------------------

root [0] 
Processing plot.cc...
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 56 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 58 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 59 points have been skipped
Warning in <TGraphAsymmErrors::Divide>: Number of graph points is different than histogram bins - 60 points have been skipped
root [1] 

and it gives me the following plot:

Dear Couet,
you have the error if you add back like 127, so when you call "GetLowerRefGraph”. This method does not work right?
Regards

A working version of your macro:
plot.cc (4.3 KB)

Dear Coyote,
I got this warning without using “GetLowerRefGraph”. Indeed when I use “GetLowerRefGraph”, it does not work at all.
Regards

take the last version of your macro I posted … it is ok.

Dear Couet,

  • yes moving “Draw()” before calling “GetLowerRefGraph()” fixe the “GetLowerRefGraph” issue!
  • But I still have the warning. Should I care about it? I do not see where this come from.
    Regards

As @Wile_E_Coyote said before: it means that the TGraphAsymErrors created from the 2 histos has less points than the number of bins in the histograms. I guess because your histograms have bin with 0 content and dividing by 0 is not possible,

Dear Coyote,
sorry I guess there was some confusion. You were right too :slight_smile: Thank you.
Regards

Dear Couet and Coyote,

  • as you can see (1), all the bins are fill, so this error message is not due to empty bins, am I wrong?
    Regards

(1)
image

Comment the range along X, as @Wile_E_Coyote suggested, and you will see that there are many empty bins:

Dear Couet and Coyote,
you are right, thank you very much!
Rergards

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