I note that the THistPainter class includes a function, Paint2DErrors(), which presumably draws error bars on a two dimentional histogram. Can someone tell me how to activate this option? I’ve tried the obvious “hist e”, “p e”, “lego e”, etc. I’m using v4.02.04 and am actually trying to paint a TProfile2D.
[quote=“couet”]Just use option E on a 2d histogram. For instance:
root [0] TFile f(“hsimple.root”)
root [1] hpxpy->Draw(“e”)
[/quote]
This is strange. I find that when I run hsimple.C, then draw as you do, I get error bars. However, for my particular histogram, the Draw(“e”) command produces a scatter plot. I’ve tried doing this inside the tutorials area to decouple my logon file, but still no error bars.
Uhh, when I do TProfile2D::ProjectionXY(), don’t I create a true 2d histo??? It certainly gives me a pointer to a TH2D, and looking under the hood it’s definitely doing “new TH2D(…”
I fail to understand this. If I have a pointer “h” to a TProfile2D, and then I call:
TH2D* hh = h->ProjectionXY();
hh->Draw("e");
then, I am drawing a TH2D, not a TProfile2D. So, it must be something to do with how the TH2D is created. However, when I do Print(“all”) for both the TProfile2D and the derived TH2D, I see output like this:
I compare the output from TProfile2D::Print(“all”) and TH2D::Print(“all”) and it’s exacly the same, including the error field which is what I assume it will try to draw. Certainly then, there is some other variable in the histogram objects that is used by Paint2DErrors(), and that variable is not being (or cannot be) set correctly. But, what varible is it?