This is to report a probable bug in TGraphErrors plotted with the “4” option (ROOT 5.26)
{
double x[3] = { 1,2,3 };
double y[3] = { 1,2,1 };
double ey[3] = { 0.1,0.2,0.1 };
TGraphErrors graph(3,x,y,0,ey);
graph.SetFillColor(kGray);
graph.Draw("A4");
graph.Draw("CPsame");
}
As you can see the error band is getting it wrong on the last point. A work-around seems to be to add a point overlapping the last one.
{
double x[4] = { 1,2,3,3 };
double y[4] = { 1,2,1,1 };
double ey[4] = { 0.1,0.2,0.1,0.1 };
TGraphErrors graph(4,x,y,0,ey);
graph.SetFillColor(kGray);
graph.Draw("A4");
graph.Draw("CPsame");
}
– Gregory