I ran into an issue where the plot created by a TTree::Draw() command had axes and labels placed at incorrect locations, as shown in the picture below, created using ROOT6.06/02.
This occurs when the values in the tree are very close together. For example, the above plot was made with the following commands.
TTree t("t","t");
double x;
t.Branch("x",&x,"x/D");
x = 2;
t.Fill();
x = 2 - 5e-16;
t.Fill();
t.Draw("x");
I run into this occasionally when all values in the tree should be numerically equal, but due to floating point rounding errors, they are not. How do I avoid this issue?
This is a precision issue. The macro you posted generates an histogram with very close X axis limits, beyond the precision level the graphics can handle. You can reproduce it with :