I defined a Graph2DErrors obj:
TGraph2DErrors dte = new TGraph2DErrors(nd);
for (Int_t i=0; iGetRandom2(x,y);
rnd = r.Uniform(-e,e); // Generate a random number in [-e,e]
z = f2->Eval(x,y)(1+rnd);
dte->SetPoint(i,x,y,z);
ex = 5r.Rndm();
ey = 5r.Rndm();
ez = TMath::Abs(z*rnd);
dte->SetPointError(i,ex,ey,ez);
}
As far as I can tell the macro described above will show the error bars of the interpolated surface made by TGraph2DErrors (am I right?).
My follow-up question is whether there is a way to plot the points given to TGraph2DErrors with error bars rather than those of the interpolated surface?
[quote]As far as I can tell the macro described above will show the error bars of the interpolated surface made by TGraph2DErrors (am I right?).
My follow-up question is whether there is a way to plot the points given to TGraph2DErrors with error bars rather than those of the interpolated surface?
[/quote]
Why do you draw this conclusion? it would not make sense.
The errors drawn are the ones specified.
I have now tried to run the code from couet above, in ordinary ROOT, and get the same result! (The code is slightly altered since the original didn’t work. Se below.) I get the error bars of the interpolated surface in the plot instead of those of my points. Can you please tell me what I am doing wrong? Is there someone out there who has the same problem?
Looking at this problem again, I see that effectively the output does not make sense. This is a big bug that will be fixed by Olivier once he will back after his holidays.
Thanks for this report
The E option has not been implemented yet for TGraph2D and TGraph2DErrors.
Right now E option is considered as an histogram option and therefore the interpolated histogram is plotted with this option. For the time being the TGraph2D specific plotting options are listed in the help here: root.cern.ch/root/html/TGraph2D.html
any other option is considered as an histogram option and therefore the interpolated histogram is plotted.
I agree with you that a some development is needed to plot the error bars at the exact points. The ouput we get with “E” option right now does not make really sense.