I have a root file containing 2 graphs (one is TGraph gr and another is TGraphAsymmErrors ge). When I try to plot gr with an error band, I have to plot ge first and then plot gr in the same canvas so that the points of gr will not be covered by the band of ge. I did in the way:
TFile * f = new TFile("test.root", "read");
TGraphAsymmErrors * ge = (TGraphAsymmErrors*)f->Get("ge");
The graph plotted looks good if I don’t change the range of y-axis (ig. ge->SetMaximum(0.25) ). I posted 1 good and 1 bad graphs here. Apparently, after resetting the range of y-axis, the graph looks wrong. Please try my root file attached.
I appreciate any hint and help.
The option 4 should be used carefully. The smooth algorithm used is very simple and often does not give good results. See the explanation here:
so even the plot you think is good is in fact wrong.
use option 3
Thanks for your reply.
Actually, neither option 3 nor 4 is not working here. Please see the uploaded graph.
It worked for me I will check again.
I get this. May be you have an old ROOT version.
Nope. The maximum value is 0.25 is fine either for me, but 0.1 is not fine, which seems that if I set a y-axis range that excludes some points the graph will be screwed up. The range 0.0 to 0.1 excludes the last point so the graph is not right, I tried 0.0 - 0.115, it is still good (because all points are in the range). In a summary, in order to plot correct error band, I have to make sure that the range covers all points.
By the way, I am using root v5.22.