Y-axis resdual plot

Hello, by this macro calocal.cpp (68.8 KB)

I can make a fit with the residual plot (notice that the macro produces many plots, but the plot whose I’m writing about is made by code at lines 1356-1413…i.e. the TCanvasa c19).

This is the obtained plot

I’ve two problems:

  1. As you can see, the y-axis of the residual plot has values too crowded and overlapping among them. Is it possible writing a lower number of values? For exampl currently the step is 0.2…is it possible to have a step 0.4? I.e. 0-0.4-0.8 etc??
    2.There are values out of the scale…how can I enlarge the scale?I wrote
    rp->GetLowerRefYaxis()->SetRange(-2.,2.);
    but it doesn’t work

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


use SetNdivisions

h->GetYaxis()-> SetNdivisions(...)
SetRangeUser(-2.,2.);

Thank you @couet
Writing

rp->GetLowerRefYaxis()-> SetNdivisions(4);
rp->GetLowerRefYaxis()->SetRangeUser(-4.,4.);

I get this plot

given taht I setted

rp->GetLowerRefYaxis()-> SetNdivisions(4);

shouldn’t I have only -4,-2,0,2,4 values?

Here the updated macro
calocal.cpp (68.9 KB)

and the root file (if you need it) WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free

fit_results.txt is missing

Hello @couet it is generated by the macro to write the Chi2 and the Ndf values

Yes it does not seems possible to change the number of division of a Ratio Plot axis.
Can you open a issue with that?
Thanks.

Where should I do that?

By clicking on “New Issue” here: https://github.com/root-project/root/issues

Hello @couet here the issue https://github.com/root-project/root/issues/9172

Thanks,
I added a simple reproducer because your example is far too complex.

Yes, no problem!
I hope you will fix the bug

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

Indeed you should use:

   rp->GetLowYaxis()->SetNdivisions(2); 

As shown is in the doc example.

1 Like