Centralize TH2 polar plot

hello

i ploted TH2 polar plot like this :

by using this code :

   TFile* f =new TFile("result.root");
   TCanvas* c1 = new TCanvas("c1", "");
   c1->SetTheta(90);
   c1->SetPhi(0.);
   TH3D* h3polar = (TH3D*)f->Get("3d_dosePOLAR");
   TH2D* h2polar=(TH2D*)h3polar->Project3D("xy COLTZ");


   double isocenter=0;
   double saad=100;
   for(Int_t i=0;i<100;i++)
   for(Int_t j=0;j<96;j++)
   isocenter+=h3polar->GetBinContent(0,j,i);
   isocenter=isocenter/96;



   TH2D* polarISO = new TH2D("p", "", 96, 0, 360, 100, 0, 100);

   for(Int_t i=0;i<96;i++)
      for(Int_t r=0;r<100;r++)
         polarISO->SetBinContent(i*3.75,r,(h2polar->GetBinContent(i,r)/isocenter)*100);
         
   polarISO->Draw(" pol colz");

I want to centralize the plot (i mean to move the center of the plot (0,0) to center of screen)

how can i do this ?

many thanks,

@couet could you please take a look later? thanks!

1 Like

I have recently answered a similar question.

1 Like