Drawing a TH2 with "Arr"

I am trying to draw a histogram using the “ARR” option, and I am getting lines all over the pad and canvas.

TH2D *blah = new TH2D("","",11,0.079,0.101,8,-0.0075,0.0005);
for (int i=blah->GetNbinsX();i++)
   {
     for (int j=blah->GetNbinsY();j++)
          {
             blah->SetBinContent(i, j, i*j);
           }
   }
blah->Draw("ARR");

I just tried this from the command line and I am getting very peculiar results, am I missing something obvious?


ROOT Version: 6.25/01
Platform: MAC-OSX
Compiler: clang-1200.0.0.32.29


I fixed your macro:

{
   TH2D *blah = new TH2D("","",11,0.079,0.101,8,-0.0075,0.0005);
   for (int i=1; i<=blah->GetNbinsX();i++) {
      for (int j=1; j<=blah->GetNbinsY();j++) blah->SetBinContent(i, j, i*j);
   }
   blah->Draw("ARR");
}

I agree the plot with option ARR is weird. I have no answer yet.
I get:

I found the fix.
In this PR.

1 Like

thanks for the quick turnaround!

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