I am trying to plot boxes in a TH3D but the result is not what I’d expect. My code looks like this:
TCanvas* c = new TCanvas("c","c",600,400);
Float_t xbins[5]={0.,50.,75.,120.,210.};
Float_t ybins[5]={0.,60.,81.2,101.2,220.};
Float_t zbins[2]={0.,100.};
TH3F* h = new TH3F("h","h",4,xbins,4,ybins,1,zbins);
h->Fill(25.,30.,50.);
h->Draw("BOX");
c->Print("lego.eps", "eps");
and I would expect to see one box from x={0,50}, y={0,60} and z={0,100} but what I see is
Can anyone tell me what I am doing wrong? Also I tried to use the glbox option, but it doesn’t plot anything, I probably have to set up something to make OpenGL work. Would you recommend to use the glbox option instead of the box option?
does the example $ROOTSYS/tuttorials/gl/glbox.C works for you ?
Is yes you can take it as model.
I think your problem may come from the fact you are using non equidistant binning.
I might be the BOX option works only for equidistant bins.
I will check
Thanks for your reply. Yes, the tutorial works for me, I will use that as a starting point. I didn’t had any problems with equidistant binning, only when I introduced a non-equidistant binning.