faca87
October 22, 2021, 12:04pm
1
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:
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
couet
October 22, 2021, 12:37pm
2
use SetNdivisions
h->GetYaxis()-> SetNdivisions(...)
faca87:
SetRange(-2.,2.);
SetRangeUser(-2.,2.);
faca87
October 22, 2021, 1:33pm
3
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
couet
October 22, 2021, 1:53pm
4
fit_results.txt
is missing
faca87
October 22, 2021, 1:55pm
5
Hello @couet it is generated by the macro to write the Chi2 and the Ndf values
couet
October 22, 2021, 2:20pm
6
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.
couet
October 22, 2021, 2:35pm
8
faca87
October 22, 2021, 2:38pm
9
couet
October 22, 2021, 2:44pm
10
Thanks,
I added a simple reproducer because your example is far too complex.
faca87
October 22, 2021, 2:45pm
11
Yes, no problem!
I hope you will fix the bug
system
Closed
November 5, 2021, 2:46pm
12
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
couet
November 11, 2021, 2:41pm
13
Indeed you should use:
rp->GetLowYaxis()->SetNdivisions(2);
As shown is in the doc example.
1 Like