faca87
December 17, 2021, 6:26pm
1
Hello, I’ve to set only integer values on the x-axis of a multi-graph becaues of the number of targets is an integer.
Following an example of @couet , I wrote
mg->GetXaxis()->SetNdivisions(8);
but the plot shows values as for example 2.5, 3.5 etc
emitarnum.cpp (2.4 KB)
Emittance_numb_target_C.txt (59 Bytes)
Emittance_numb_target_Be.txt (63 Bytes)
Thank you
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
https://root.cern/root/html606/classTAttAxis.html#ae3067b6d4218970d09418291cbd84084
Try experimenting yourself to understand it and find a value that works for what you want.
1 Like
couet
December 20, 2021, 7:46am
3
There is several ways to achieve this, but as you already set the number of divisions in your macro, the simplest is:
mg->GetXaxis()->SetNdivisions(6);
faca87
December 21, 2021, 7:14am
4
Thanks to the both @dastudillo and @couet
system
Closed
January 4, 2022, 7:14am
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.