# Centralize TH2 polar plot

**URL:** <https://root-forum.cern.ch/t/centralize-th2-polar-plot/45274>\
**Category:** Newbie\
**Created:** [June 6, 2021, 9:36am UTC](https://root-forum.cern.ch/t/centralize-th2-polar-plot/45274 "2021-06-06T09:36:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keyvan\_Tabaei](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/keyvan_tabaei/32/25908_2.png) [@Keyvan\_Tabaei](https://root-forum.cern.ch/u/Keyvan_Tabaei)\
**Post date:** [June 6, 2021, 9:36am UTC](https://root-forum.cern.ch/t/centralize-th2-polar-plot/45274/1 "2021-06-06T09:36:26Z")

</div>

hello

i ploted TH2 polar plot like this :

 ![Screenshot from 2021-06-06 05-14-33](https://root-forum.cern.ch/uploads/default/original/3X/9/6/968887af85f0d99c9af2b665178148651cdb58e4.png)

by using this code :

```auto
   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,

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [June 7, 2021, 9:00am UTC](https://root-forum.cern.ch/t/centralize-th2-polar-plot/45274/2 "2021-06-07T09:00:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [June 15, 2021, 8:16am UTC](https://root-forum.cern.ch/t/centralize-th2-polar-plot/45274/3 "2021-06-15T08:16:19Z")

</div>

I have recently answered a [similar question](https://root-forum.cern.ch/t/polar-axis-for-histogram/45194/4).
