Create a polar graph using a TF1 and draw it with PI axis.
See the TGraphPolar documentation
Since TGraphPolar is a TGraphErrors, it is painted with TGraphPainter options.
void gr014_polar3()
{
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]);
}
}
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
void Draw(Option_t *options="") override
Default Draw method for all objects.
void SetTitle(const char *title="") override
Set the title of the TNamed.
- Author
- Olivier Couet
Definition in file gr014_polar3.C.