Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
gr014_polar3.C File Reference

Detailed Description

View in nbviewer Open in SWAN
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.

{
TCanvas *CPol = new TCanvas("CPol","TGraphPolar Examples",500,500);
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");
}
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
The Canvas class.
Definition TCanvas.h:23
1-Dim function class
Definition TF1.h:233
To draw a polar graph.
Definition TGraphPolar.h:23
constexpr Double_t Pi()
Definition TMath.h:37
Author
Olivier Couet

Definition in file gr014_polar3.C.