Logo ROOT  
Reference Guide
graphpolar2.C File Reference

Detailed Description

View in nbviewer Open in SWAN Create and draw a polar graph with PI axis

void graphpolar2()
{
TCanvas * CPol = new TCanvas("CPol","TGraphPolar Example",500,500);
Double_t theta[8];
Double_t radius[8];
Double_t etheta[8];
Double_t eradius[8];
for (int i=0; i<8; i++) {
theta[i] = (i+1)*(TMath::Pi()/4.);
radius[i] = (i+1)*0.05;
etheta[i] = TMath::Pi()/8.;
eradius[i] = 0.05;
}
TGraphPolar * grP1 = new TGraphPolar(8, theta, radius, etheta, eradius);
grP1->SetTitle("");
grP1->SetMarkerStyle(20);
grP1->SetMarkerSize(2.);
grP1->SetMarkerColor(4);
grP1->SetLineColor(2);
grP1->SetLineWidth(3);
grP1->Draw("PE");
CPol->Update();
}
double Double_t
Definition: RtypesCore.h:57
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition: TAttMarker.h:38
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition: TAttMarker.h:40
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition: TAttMarker.h:41
The Canvas class.
Definition: TCanvas.h:27
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2433
To draw a polar graph.
Definition: TGraphPolar.h:22
TGraphPolargram * GetPolargram()
Definition: TGraphPolar.h:39
void Draw(Option_t *options="")
Draw TGraphPolar.
void SetToRadian()
The Polar circle is labelled using radian.
virtual void SetTitle(const char *title="")
Change (i.e.
Definition: TGraph.cxx:2324
constexpr Double_t Pi()
Definition: TMath.h:38
Author
Olivier Couet

Definition in file graphpolar2.C.