TH3D BOX draw option overlap

Hi Rooter’s
I am trying to plot a 3D with BOX options. But the box is overlap a half.
The following is a working eaxmple:

 TH3D* hh2 = new TH3D(,,5,-105,105,42,-105,105,60,0,30);
    for(int i_x=1; i_x<=5; i_x++)
    {
        for(int i_y=1; i_y<=42; i_y++)
        {
            hh2->SetBinContent(i_x,i_y,40,0.1);
        }
    }

    TCanvas* cc = new TCanvas(,,0,0,800,800);
    gStyle ->SetOptStat(0000);
    hh2 ->SetFillColor(2);
    hh2->Draw("BOX");

I tried ROOT Version:5.34.18
ROOT Version:6.04.10

Thank you,

All the best,
YaJoe

You need a (much) newer ROOT version.

2 Likes

With the latest ROOT version your macro produces the following plot:

thank you for your reply. I get the same result with the latest ROOT version. but I’m still wondering that I have realize the function with ROOT: 5.34.18 just once and I can’t repeat the result.

all the best,
YaJoe

Thank you for your reply. I solve this problem with the latest ROOT.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.