From $ROOTSYS/tutorials/graphs/graphpolar3.C

//Create and draw a polar graph with PI axis using a TF1
//Author: Olivier Couet
   
void graphpolar3()
{
   TCanvas * CPol = new TCanvas("CPol","TGraphPolar Examples",500,500);

   Double_t rmin=0;
   Double_t rmax=TMath::Pi()*2;
   Double_t r[1000];
   Double_t theta[1000];

   TF1 * fp1 = new TF1("fplot","cos(x)",rmin,rmax);
   for (Int_t ipt = 0; ipt < 1000; ipt++) {
      r[ipt] = ipt*(rmax-rmin)/1000+rmin;
      theta[ipt] = fp1->Eval(r[ipt]);
   }
   TGraphPolar * grP1 = new TGraphPolar(1000,r,theta);
   grP1->SetTitle("");
   grP1->SetLineColor(2);
   grP1->Draw("AOL");
}
 graphpolar3.C:1
 graphpolar3.C:2
 graphpolar3.C:3
 graphpolar3.C:4
 graphpolar3.C:5
 graphpolar3.C:6
 graphpolar3.C:7
 graphpolar3.C:8
 graphpolar3.C:9
 graphpolar3.C:10
 graphpolar3.C:11
 graphpolar3.C:12
 graphpolar3.C:13
 graphpolar3.C:14
 graphpolar3.C:15
 graphpolar3.C:16
 graphpolar3.C:17
 graphpolar3.C:18
 graphpolar3.C:19
 graphpolar3.C:20
 graphpolar3.C:21
 graphpolar3.C:22
 graphpolar3.C:23