ROOT logo
void
polar()
{
   TCanvas *c1 = new TCanvas("c1","c1",500,500);
   TGraphPolar * grP1 = new TGraphPolar();
   grP1->SetTitle("TGraphPolar example");

   for (Int_t i = 0; i < 2; i++) {
     grP1->SetPoint(i, (i+1) * TMath::Pi() / 4, (i+1) * 0.05);
     grP1->SetPointError(i, 9*TMath::Pi()/180, 0.0);
     Double_t rr = grP1->GetY()[i];
     Double_t tt = grP1->GetX()[i];
     Double_t x  = rr * TMath::Cos(tt);
     Double_t y  = rr * TMath::Sin(tt);
     Printf("(x,y)=(%f,%f)", x, y);
   }
   Double_t r = 1;
   TH2* frame = new TH2F("frame", "Frame", 100, -r,r, 100, -r, r);
   frame->Draw();

   grP1->SetMarkerStyle(1);
   grP1->SetMarkerSize(1.);
   grP1->SetMarkerColor(4);
   grP1->SetLineColor(4);
   grP1->SetLineWidth(3);
   grP1->SetFillColor(kRed+1);
   grP1->SetFillStyle(3001);
   grP1->Draw("PNEF same");
   // grP1->Draw("APNEF");

   // Update, otherwise GetPolargram returns 0
   c1->Update();
   TGraphPolargram* gram = grP1->GetPolargram();
   gram->SetLineWidth(0);
   // gram->SetLineColor(kWhite);
   gram->SetNdivPolar(20);
   gram->SetNdivRadial(10);   
   gram->SetTextSize(0);
   gram->SetRadialLabelSize(0);
   gram->SetPolarLabelSize(0);
   gram->SetAxisAngle(9*TMath::Pi()/180);
   gram->SetTwoPi();
   gram->SetToRadian();
   c1->SetGridx();
   c1->SetGridy();
   c1->Update();
}
 polar.C:1
 polar.C:2
 polar.C:3
 polar.C:4
 polar.C:5
 polar.C:6
 polar.C:7
 polar.C:8
 polar.C:9
 polar.C:10
 polar.C:11
 polar.C:12
 polar.C:13
 polar.C:14
 polar.C:15
 polar.C:16
 polar.C:17
 polar.C:18
 polar.C:19
 polar.C:20
 polar.C:21
 polar.C:22
 polar.C:23
 polar.C:24
 polar.C:25
 polar.C:26
 polar.C:27
 polar.C:28
 polar.C:29
 polar.C:30
 polar.C:31
 polar.C:32
 polar.C:33
 polar.C:34
 polar.C:35
 polar.C:36
 polar.C:37
 polar.C:38
 polar.C:39
 polar.C:40
 polar.C:41
 polar.C:42
 polar.C:43
 polar.C:44
 polar.C:45
 polar.C:46
 polar.C:47
 polar.C:48